0

I want to design a rounding policy for several components:

    //  | exchange     | type  | routing key                | queue                        |
    //  |--------------|-------|----------------------------|------------------------------|
    //  | processing   | topic | processing.trx.elavon      | processing-elavon-sale       |
    //  | processing   | topic | processing.trx.elavon      | processing-elavon-authorize  |
    //  | processing   | topic | processing.trx.elavon      | processing-elavon-capture    |
    //  | processing   | topic | processing.trx.genesis     | processing-genesis-sale      |

I tried with Topic exchange and Direct exchange but I get error Reply received after timeout. After investigation it turns out that I'm sending messages to 1 queue but 2 queues are receding messages.

My caseI would like to use routing key and as additional level or abstraction as configuration variable for the target gateway and then to send the type of message to a queue.

But looks like this design is not appropriate.

What routing policy should be more suitable in order to avoid the error: Reply received after timeout? Only one queue should receive the message and reply.

EDIT:

In my case I use Spring AMQP to send messages:

convertSendAndReceive(
        ContextServer.EXCHANGE_PROCESSING, ContextServer.ROUTING_KEY_PROCESSING_TRANSACTION_ELAVON, "some_payload");

But how I can reach just one queue processing-elavon-sale, not all queues bind to routing key processing.trx.elavon?

Peter Penzov
  • 1,126
  • 134
  • 430
  • 808
  • From your configuration extract, the messages with routing key `processing.trx.elavon` would reach 3 different queues (processing-elavon-sale, processing-elavon-authorize, processing-elavon-capture). In the case of topic, you send your messages to an exchange, the binding (link) between the exchange and queues decides wether your message would reach zero, one or more queues. If you could clarify which queue should get your message out of the 3, and what is the purpose of the other 2 queues, it would help clarify your need. – Olivier Feb 03 '19 at 12:41
  • @Olivier In my case I want to send one message type per queue. `Message 1` -> only queue `processing-elavon-sale` should receive it – Peter Penzov Feb 03 '19 at 13:48
  • @Olivier What if I create for every queue separate "dedicated" routing key? – Peter Penzov Feb 03 '19 at 14:14
  • if you have distinct routing patterns in each of your binding, only 1 queue will receive each message (assuming the routing pattern doesn't make use of wildcards like * and #). – Olivier Feb 04 '19 at 07:13
  • ok, I will go with the solution one routing key -> one queue. – Peter Penzov Feb 04 '19 at 07:29

0 Answers0