camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From #S-SmixDev <smix...@dzbank.de>
Subject Re: JMS vs MQ message
Date Thu, 07 Apr 2016 10:20:57 GMT
targetClient=1 means there are no headers except the standard properties
from the MQMD header on the message. You can not send custom headers that
way.

And specifying the targetClient does not have any effect whatsoever when
reading messages from a  queue.

Regards,
Jens



Von:	blommis <johan.blomgren88@gmail.com>
An:	users@camel.apache.org,
Datum:	07.04.2016 11:31
Betreff:	JMS vs MQ message


I'm trying to receive a JMS message and send it to a MQ queue, keeping
headers on the message.
But headers are sent when using targetClient=1.

So when using the following, no headers are sent.
from("*wmq:queue:A0*").log("${headers}");
template.sendBodyAndHeader("*wmq:queue:A0*", "body", "h1", "headervalue");

However, when having a component called wmqJms (using wmq but without
targetClient=1), it does read headers, even if I have from wmq. But then
when forwarding the message to a wmq component (targetClient=1), there is
no
headers on the A1 queue
from("*wmq:queue:A0*").log("${headers}").to("wmq:queue:A1");
template.sendBodyAndHeader("*wmqJms:queue:A0*", "body", "h1",
"headervalue");


public static Component createMQComponent(Properties properties) throws
JMSException {
        JmsComponent jmsComponent = getJmsComponent(properties);
        jmsComponent.setDestinationResolver(new DestinationResolver() {
            @Override
            public Destination resolveDestinationName(Session session,
String destinationName, boolean pubSubDomain) throws JMSException {
                MQQueueSession mqSession = (MQQueueSession) session;
                return session.createQueue("queue:///" + destinationName +
"?targetClient=1");
            }
        });
        return jmsComponent;
    }

    private static JmsComponent getJmsComponent(Properties properties)
throws JMSException {
        return MQComponentBuilder.mqComponent(
                    properties.getPropertyNotNull("wmq.hostname"),

Integer.parseInt(properties.getPropertyNotNull("wmq.port")),
                    properties.getPropertyNotNull("wmq.username"),
                    properties.getPropertyNotNull("wmq.password"),
                    properties.getPropertyNotNull("wmq.queueManager"),
                    properties.getPropertyNotNull("wmq.channel")
            );
    }



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



Mime
View raw message