msqar
msqar

Reputation: 3040

When a Mule message passed through inbound JMS component, removes header properties?

I got an outbound and inbound JMS component, and whenever the message passes through it, i lose all the header properties automatically, so basically only the message payload is sent.

What do you guys suggest me to do ? send the variables through the message as JMS Properties?

Thanks.

Upvotes: 0

Views: 2663

Answers (2)

user1760178
user1760178

Reputation: 6697

When ever a message passes through an Endpoint all the Inbound properties and Invocation variables are lost. Only the Outbound properties and Session variables are carried along.

All the Outbound properties will be availabe as inbound properties at the receiving end.

Upvotes: 2

Charu Khurana
Charu Khurana

Reputation: 4551

Inbound Properties are not propagated across transports. You'll lose them unless you copy them explicitly.

Outbound Properties are copied and will be received as inbound properties when you sent an outbound request to JMS queue (or to any other transport for that matter).

When you receive an inbound request and now intent is that properties are propagated to outbound endpoint, copy explicitly the properties you want or do a shortcut step and copy all the properties like this after your inbound endpoint.

<flow name="flowName">
    <jms:inbound-endpoint queue="queueName" exchange-pattern="one-way" />
    <copy-properties propertyName="*" />
.....
</flow>

This will

<copy-properties propertyName="*" />

copy the the inbound properties coming in flowName to outbound properties.

Also make sure you're accessing properties correctly.

Accessing inbound property: #[message.inboundProperties['propertyName']]

Accessing outbound property: #[message.outboundProperties['propertyName']]

Invocation variables are confined within flow.

Upvotes: 2

Related Questions