[prev in list] [next in list] [prev in thread] [next in thread] 

List:       activemq-users
Subject:    Re: Smallrye reactive messaging's emitter does not NACK messages sent to Artemis broker
From:       Robbie Gemmell <robbie.gemmell () gmail ! com>
Date:       2023-07-10 16:35:10
Message-ID: CAFitrpTX+AbNY4rpOq8LAfZDw2Rt_AJ5BXRf02wbFZi_ZjF0Zg () mail ! gmail ! com
[Download RAW message or body]

The brokers auto-creation handling defaults to creating 'multicast'
addresses+queues unless requested otherwise by either the connecting
producer specifying what it wants, or by updating the brokers default
address configuration for that address. That is, it gives topic-like
pub-sub behaviour if not asked otherwise. You dont seem to create any
consumers/subscriptions. If so the message was presumably received,
accepted, and discarded as there were no subscriptions for it.
"Couldn't find any bindings for address=random-address "is saying
there were no [subscription-backing] queues bound to that address to
put the message on.

It sounds like you want 'queue' like behaviour instead, i.e create
queue of that name if needed and put the message on it for later. You
can either configure the address settings to get this 'anycast'
behaviour (i.e queue like behaviour) by default upon auto-creation for
clients not requesting specific behaviour, or you ensure your client
requests the behaviour it actually wants.

For the former, see the broker documentation:
https://activemq.apache.org/components/artemis/documentation/
E.g perhaps https://activemq.apache.org/components/artemis/documentation/latest/address-model.html
and https://activemq.apache.org/components/artemis/documentation/latest/address-settings.html

For the latter, looks like you can use the 'capabilities' config for
smallrye-reactive-messaging-amqp to configure what you want. You might
try "queue" or "topic" depending on what behaviour you want to
request:
https://smallrye.io/smallrye-reactive-messaging/4.7.0/amqp/sending-amqp-messages/#configuration-reference

Alternatively still, you could pre-create the addresses and queues you
want to use by specifying them in the broker config to pre-create
them.

On Fri, 7 Jul 2023 at 13:22, Nicolaescu, Eugeniu
<e.nicolaescu@techgap.it> wrote:
>
> I'm facing an issue when using the AMQP connector and an Apache Artemis
> broker and I'm not sure if it's an error on my part somehow or one of the
> two doesn't handle this case properly
>
> Problem: I send a message to the broker using an emitter, if the target
> address does not have a queue the broker will log the error:
> Couldn't find any bindings for address=random-address on
> message=AMQPStandardMessage......
> The message is never sent to any queue and is lost, but the emitter does
> not NACK the message nor it reports any error on the quarkus CLI
>
>
>
> How to reproduce:
>
> Start the apache artemis container:
> ```
> docker pull quay.io/artemiscloud/activemq-artemis-broker:artemis.2.27.1
> docker run -d -p 8161:8161 -p 61616:61616 -e AMQ_USER=artemis -e
> AMQ_PASSWORD=artemis -e AMQ_EXTRA_ARGS: "--host 0.0.0.0 --http-host 0.0.0.0
> --relax-jolokia" quay.io/artemiscloud/activemq-artemis-broker:artemis.2.27.1
> ```
>
> The console is accessible at localhost:8161 with credentials artemis/artemis
> You should also go to JMX -> org.apache.logging.log4j2 ->
> org.apache.activemq logger and set the log level to DEBUG
>
>
> Run the message producer:
> clone https://github.com/quarkusio/quarkus-quickstarts
> cd  .\amqp-quickstart
> update the properties file
> .\amqp-quickstart\amqp-quickstart-producer\src\main\resources\application.properties
> by adding these properties:
> ```
> amqp-host=localhost
> amqp-port=61616
> amqp-username=artemis
> amqp-password=artemis
>
> mp.messaging.outgoing.quote-requests.connector=smallrye-amqp
> mp.messaging.outgoing.quote-requests.address=random-address
> mp.messaging.outgoing.quote-requests.durable=true
> ```
>
> Run the producer:
> `mvn -f amqp-quickstart-producer quarkus:dev`
>
> Now you can send a message to the artemis broker by sending a post request
> to http://localhost:8080/quotes/request
>
> You could also update the QuotesResource.java class by checking the emitter
> result like this:
> ```
> CompletionStage<Void> completionStage =
> quoteRequestEmitter.send(uuid.toString()); // <2>
> completionStage.toCompletableFuture().join();
> ```
>
> but it's the same thing, no error is reported
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic