Hello! I am not from the Camel team but maybe I might be able to help.
Do I understand correctly that you need to consume only messages that have
a specific header value? In that case you want to use jms selector, like in
the example here:
https://camel.apache.org/components/4.0.x/eips/selective-consumer.html
Hovewer, afaik, the jms selector only work with jms properties values, so
you will need to have your ENV value in jms property and not in the message
body.

On Mon, Jan 15, 2024 at 3:44 AM Srikant Mantha <mantha.srik...@outlook.com>
wrote:

> Hi Team,
> I am reading messages from IBM MQ and using Camel JMS component. This
> process is happening successfully so far. The below route for reference:
>
> From(mq:queue:myQueueName)
> .process(myProcessor)
>
> This application will be deployed in more than 2 environments, but the IBM
> queue connections are same. When this happens, the application will try to
> read the same payload from the IBM MQ queue.
> I would like to process the message based on a header attribute and skip
> when it’s not applicable.
> Refer the header text with XML payload that is currently coming as part of
> the camel body.
>
> This will be for env1
>
> ###<UUID>#ENV1
> <Orders id=1>
>   <Order1>
>   </Order1>
>   <Order2>
>   </Order2>
>   <Order3>
>   </Order3>
> </Orders>
>
> This will be for env2
>
> ###<UUID>#ENV2
> <Orders id=2>
>   <Order1>
>   </Order1>
>   <Order2>
>   </Order2>
>   <Order3>
>   </Order3>
> </Orders>
>
> That mean, the transaction must not be completed when it’s not applicable
> and the payload stays in the IBM messaging queue for the application
> running in a different env.
>
> I would like to know:
>
>   1.  How to process such scenarios in the camel route.
>   2.  Can I use camel splitter to trim the header part under the body as
> it’s a plain text format.
>   3.  Is my message considered as consumed when I read the payload and
> does the above processing since the order Ids may be different per
> environment.
>   4.  Can I customize the transaction based on this logic. Is it possible
> to configure in the route or else where ?
>
> -Regards
> Srikant Mantha
>
>
>

Reply via email to