After trying out Quarkus with Kafka Iām wondering how to use it with ActiveMQ. I was not able to find any documentation. Quarkus.io mentions support for amqp protocoll.
Does somebody know how to achieve this?
After trying out Quarkus with Kafka Iām wondering how to use it with ActiveMQ. I was not able to find any documentation. Quarkus.io mentions support for amqp protocoll.
Does somebody know how to achieve this?
Additionally to the answer provided by @John Clingan (Thanks!) to use VertX directly, you can also use microprofile-reactive-messaging:
git clone https://github.com/smallrye/smallrye-reactive-messaging.git
cd smallrye-reactive-messaging
mvn install
<dependency>
<groupId>io.smallrye.reactive</groupId>
<artifactId>smallrye-reactive-messaging-amqp</artifactId>
<version>0.0.8-SNAPSHOT</version>
</dependency>
# amqp output
smallrye.messaging.sink.my-amqp-output.type=io.smallrye.reactive.messaging.amqp.Amqp
smallrye.messaging.sink.my-amqp-output.address=test-activemq-amqp
smallrye.messaging.sink.my-amqp-output.containerId=test-activemq-clientid
smallrye.messaging.sink.my-amqp-output.host=localhost
# amqp input
smallrye.messaging.source.my-amqp-input.type=io.smallrye.reactive.messaging.amqp.Amqp
smallrye.messaging.source.my-amqp-input.address=test-activemq-amqp
smallrye.messaging.source.my-amqp-input.containerId=test-activemq-clientid
smallrye.messaging.source.my-amqp-input.host=localhost
3.1 Sending messages from a rest servlet
@Path("/hello")
public class HelloWorldResource {
@Inject
@Stream("my-amqp-output")
Emitter<String> emitter;
@GET
@Produces(MediaType.TEXT_PLAIN)
public String hello() {
emitter.send("hello!");
return "hello send";
}
}
3.2 Receiving messages
@ApplicationScoped
public class AmqpReceiver {
@Incoming("my-amqp-input")
public void receive(String input) {
//process message
}
}
Tested with quarkus 0.14.0 and 0.13.3.