Skip to main content

flamme

A quarkus extension for building Java distributed applications, without distributed complexity. Inspired by google's service weaver.

Get Started →
Hello, World 🌎
import io.github.amadeusitgroup.flamme.runtime.annotations.Flamme;
import io.github.amadeusitgroup.flamme.runtime.annotations.FlammeImpl;
import com.google.protobuf.Any;
import com.google.protobuf.InvalidProtocolBufferException;
import com.google.protobuf.StringValue;
import jakarta.inject.Inject;

@Flamme(serviceName = "greeter", consumes = {}, produces = {})
public interface GreeterService {
Any sayHello(Any payload);
}

@FlammeImpl
class GreeterServiceImpl implements GreeterService {
@Override
public Any sayHello(Any payload) {
try {
StringValue name = payload.unpack(StringValue.class);
return Any.pack(StringValue.of("Hello, " + name.getValue() + "!"));
} catch (InvalidProtocolBufferException e) {
throw new RuntimeException(e);
}
}
}

class GreeterResource {
@Inject
GreeterService greeterService;

String greet() {
Any response = greeterService.sayHello(Any.pack(StringValue.of("World")));
try {
return response.unpack(StringValue.class).getValue();
} catch (InvalidProtocolBufferException e) {
throw new RuntimeException(e);
}
}
}
# Run as distributed
# First Node hosts only the resource.
java -jar -Dflamme.services.greeter.remote=true -Dquarkus.http.port=8080 ./quarkus-run.jar

# Second Node hosts the flamme component and doesn't listen on http.
java -jar -Dflamme.services.greeter.remote=false -Dquarkus.http.host-enabled=false ./quarkus-run.jar

# Or, run everything together
java -jar ./quarkus-run.jar
Flamme is made possible by:
sonofthecomet-ctrl avatarjolebob avatar