Re: RabbitMQ set replyTo queue

2021-12-06 Thread V User
Hi Claus,

It looks like the spring-rabbitmq feature is set up to use the RabbitMQ
"direct reply-to" paradigm (
https://camel.apache.org/components/3.13.x/spring-rabbitmq-component.html#_request_reply),
which is not how the target application is implemented (i.e. it is not
reading from the amq.rabbitmq.reply-to queue or publishing to a
response queue defined by the message header; there's a pre-defined input
queue it reads messages from and a pre-defined output queue it publishes
responses to).

I think I've found what I need with the JMS connector & an exclusive
response queue though (
https://camel.apache.org/components/3.13.x/jms-component.html#_request_reply_over_jms).
Fortunately, the target application is able to support JMS.

-Zoe

On Sat, Dec 4, 2021 at 12:12 AM Claus Ibsen  wrote:

> Hi
>
> Can you try with the spring-rabbitmq component
>
> On Fri, Dec 3, 2021 at 11:38 PM V User  wrote:
> >
> > Hello!
> >
> > I'm new to Camel and setting up my first flow, an adaptor for an existing
> > system with an API that uses RabbitMQ. The API already defines a queue to
> > publish messages to, and a queue where responses will be published back
> to.
> > I'm trying to get Camel to read replies from the existing queue. I
> thought
> > that setting the CamelRabbitmqReplyTo header (
> >
> https://camel.apache.org/components/3.13.x/rabbitmq-component.html#_message_headers
> )
> > on the exchange during a processor call would do it, but it seems that
> > value gets overwritten by the RabbitMQProducer during processing. Is this
> > the intended behavior? Is there a different stage I should be setting it
> on
> > that would catch it post-process or something? I also can't find any
> config
> > option to set a ReplyTo value on the RabbitMQ component or anything like
> > that.
> >
> > For reference, here's my route configuration:
> > from("netty:tcp://{{tcp.host}}:{{tcp.port.number}}?sync=true")
> > .process(m_inboundProcessor)
> > .to("rabbitmq:camel?"
> > + "request-Timeout=3000&"
> > + "connectionFactory=rabbitmqConnectionFactory&"
> > + "queue={{rabbitmq.exchange.routingKey}}&"
> > + "routingKey={{rabbitmq.exchange.routingKey}}&"
> > + "autoDelete=false&"
> > + "allowCustomHeaders=true")
> > .log("Received body: ${body}");
> >
> > And here's the relevant line from m_inboundProcessor:
> > exchange.getIn().getHeaders().put("CamelRabbitmqReplyTo",
> > "apiQueueName");
> >
> > Is extending TemporaryQueueReplyManager to set a standard value for
> replyTo
> > maybe possible?
> >
> > Thanks,
> > Zoe
>
>
>
> --
> Claus Ibsen
> -
> http://davsclaus.com @davsclaus
> Camel in Action 2: https://www.manning.com/ibsen2
>


Re: RabbitMQ set replyTo queue

2021-12-04 Thread Claus Ibsen
Hi

Can you try with the spring-rabbitmq component

On Fri, Dec 3, 2021 at 11:38 PM V User  wrote:
>
> Hello!
>
> I'm new to Camel and setting up my first flow, an adaptor for an existing
> system with an API that uses RabbitMQ. The API already defines a queue to
> publish messages to, and a queue where responses will be published back to.
> I'm trying to get Camel to read replies from the existing queue. I thought
> that setting the CamelRabbitmqReplyTo header (
> https://camel.apache.org/components/3.13.x/rabbitmq-component.html#_message_headers)
> on the exchange during a processor call would do it, but it seems that
> value gets overwritten by the RabbitMQProducer during processing. Is this
> the intended behavior? Is there a different stage I should be setting it on
> that would catch it post-process or something? I also can't find any config
> option to set a ReplyTo value on the RabbitMQ component or anything like
> that.
>
> For reference, here's my route configuration:
> from("netty:tcp://{{tcp.host}}:{{tcp.port.number}}?sync=true")
> .process(m_inboundProcessor)
> .to("rabbitmq:camel?"
> + "request-Timeout=3000&"
> + "connectionFactory=rabbitmqConnectionFactory&"
> + "queue={{rabbitmq.exchange.routingKey}}&"
> + "routingKey={{rabbitmq.exchange.routingKey}}&"
> + "autoDelete=false&"
> + "allowCustomHeaders=true")
> .log("Received body: ${body}");
>
> And here's the relevant line from m_inboundProcessor:
> exchange.getIn().getHeaders().put("CamelRabbitmqReplyTo",
> "apiQueueName");
>
> Is extending TemporaryQueueReplyManager to set a standard value for replyTo
> maybe possible?
>
> Thanks,
> Zoe



-- 
Claus Ibsen
-
http://davsclaus.com @davsclaus
Camel in Action 2: https://www.manning.com/ibsen2