You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by mjok <mj...@singleton-labs.lt> on 2016/07/21 14:25:17 UTC

WMQ message context

I am writing camel application witch uses Content Based Router EIP.

This aplication routes the message from source Queue, and based on message
body's xml field forwards message to another Queue.

I'd like that my router be as transperent as possible. So I'd like that
camel do not change message context.
So source's and destination's message fields:

MsgType, MsgId, Expiry, Feedback, Encoding, ReplyToQ....                       
PutApplType, PutApplName, PutDate, PutTime....

...expected to be the same..

I have tried setting "forceSendOriginalMessage=true"
But it seem's it doesn't help much... I'am getting changed MsgId,
PutApplName, PutTime fields changed by ?Camel? or ibm.wmq.


My configuration: (I am using mixed spring and Java DSL)

<..>
from(resolvedQueue).to("direct:routeEnd");
<..>


<route errorHandlerRef="deadLetterErrorHandler" streamCache="true">
            
            <from uri="direct:routeEnd"/>
            <to uri="bean:destinationHandler?method=resolveDestination"/>
            <toD
uri="mqT:$simple{bean:mqRouteBuilder.toPrefix}+$simple{header.Destination}+$simple{bean:mqRouteBuilder.toSeparator}+$simple{in.header.mType}+$simple{bean:mqRouteBuilder.toSuffix}?transacted=true&amp;forceSendOriginalMessage=true&amp;preserveMessageQos=true"/>
            <to uri="bean:OptionalHistoryQueueHandler"/>
</route>



Regards
Marius

                      




--
View this message in context: http://camel.465427.n5.nabble.com/WMQ-message-context-tp5785336.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: WMQ message context

Posted by mjok <mj...@singleton-labs.lt>.
Changing MQMD values might work I think. 

Might you point me How I could access it from camel message?



--
View this message in context: http://camel.465427.n5.nabble.com/WMQ-message-context-tp5785336p5785361.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: WMQ message context

Posted by souciance <so...@gmail.com>.
Well, not quit sure I follow you there about other software  and still
think it is not a good idea to copy those specific headers.

Most likely the WMQ protocol are creating new values for those headers when
the message is actually put on the queue. I am not sure you can actually
change that.

You could try to create a Processor class which basically hard codes the
destination headers one by one with values from source and see if that
helps.

Alternatively, copy those headers into the MQRFH2 header which is usually
not changed by WMQ. It is used when you want to include meta-information
about the message. So you can create a new structure in MQRFH2 called
sourceMQMD and copy all the source headers in there and this can be then
viewed when you want to know the source MQMD headers.

On Fri, Jul 22, 2016 at 1:11 PM, mjok [via Camel] <
ml-node+s465427n5785358h61@n5.nabble.com> wrote:

> Well, it's an legacy system, I might have a problem with other software
> witch is using messages from destination queue.
> Besides it's in requirements..
>
> ------------------------------
> If you reply to this email, your message will be added to the discussion
> below:
>
> http://camel.465427.n5.nabble.com/WMQ-message-context-tp5785336p5785358.html
> To start a new topic under Camel - Users, email
> ml-node+s465427n465428h31@n5.nabble.com
> To unsubscribe from Camel - Users, click here
> <http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=465428&code=c291Y2lhbmNlLmVxZGFtLnJhc2h0aUBnbWFpbC5jb218NDY1NDI4fDE1MzI5MTE2NTY=>
> .
> NAML
> <http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>




--
View this message in context: http://camel.465427.n5.nabble.com/WMQ-message-context-tp5785336p5785359.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: WMQ message context

Posted by mjok <mj...@singleton-labs.lt>.
Well, it's an legacy system, I might have a problem with other software witch
is using messages from destination queue.  
Besides it's in requirements..



--
View this message in context: http://camel.465427.n5.nabble.com/WMQ-message-context-tp5785336p5785358.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: WMQ message context

Posted by souciance <so...@gmail.com>.
Why would you want them to be the same? WMQ message header properties are a
good way to debug when things go wrong. If you don't know exactly when and
who put the message that makes it hearder to debug. If you wanted to put
the MessageId or CorrelationId for a request/reply scenario then yes, but
why here?

On Thu, Jul 21, 2016 at 4:25 PM, mjok [via Camel] <
ml-node+s465427n5785336h79@n5.nabble.com> wrote:

> I am writing camel application witch uses Content Based Router EIP.
>
> This aplication routes the message from source Queue, and based on message
> body's xml field forwards message to another Queue.
>
> I'd like that my router be as transperent as possible. So I'd like that
> camel do not change message context.
> So source's and destination's message fields:
>
> MsgType, MsgId, Expiry, Feedback, Encoding, ReplyToQ....
>
> PutApplType, PutApplName, PutDate, PutTime....
>
> ...expected to be the same..
>
> I have tried setting "forceSendOriginalMessage=true"
> But it seem's it doesn't help much... I'am getting changed MsgId,
> PutApplName, PutTime fields changed by ?Camel? or ibm.wmq.
>
>
> My configuration: (I am using mixed spring and Java DSL)
>
> <..>
> from(resolvedQueue).to("direct:routeEnd");
> <..>
>
>
> <route errorHandlerRef="deadLetterErrorHandler" streamCache="true">
>
>             <from uri="direct:routeEnd"/>
>             <to uri="bean:destinationHandler?method=resolveDestination"/>
>             <toD
> uri="mqT:$simple{bean:mqRouteBuilder.toPrefix}+$simple{header.Destination}+$simple{bean:mqRouteBuilder.toSeparator}+$simple{in.header.mType}+$simple{bean:mqRouteBuilder.toSuffix}?transacted=true&amp;forceSendOriginalMessage=true&amp;preserveMessageQos=true"/>
>             <to uri="bean:OptionalHistoryQueueHandler"/>
> </route>
>
>
>
> Regards
> Marius
>
>
>
>
> ------------------------------
> If you reply to this email, your message will be added to the discussion
> below:
> http://camel.465427.n5.nabble.com/WMQ-message-context-tp5785336.html
> To start a new topic under Camel - Users, email
> ml-node+s465427n465428h31@n5.nabble.com
> To unsubscribe from Camel - Users, click here
> <http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=465428&code=c291Y2lhbmNlLmVxZGFtLnJhc2h0aUBnbWFpbC5jb218NDY1NDI4fDE1MzI5MTE2NTY=>
> .
> NAML
> <http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>




--
View this message in context: http://camel.465427.n5.nabble.com/WMQ-message-context-tp5785336p5785339.html
Sent from the Camel - Users mailing list archive at Nabble.com.