tJMSOutput body + header

Highlighted

tJMSOutput body + header

Hello,
In my jobs I use tJMSOutput and in my route I call cJMS.
When I use tJMSOutput I want to pass a xml and some data in header.
It's possible ?
Best regards,
lmartin
Highlighted
Moderator

Re: tJMSOutput body + header

Hi,
Can you try to put a JavaRow with such a code before your tJMSOutput 
javax.jms.TextMessage m = session_tJMSOutput_1.createTextMessage();
m.setText(message);
m.setStringProperty("Action","Update");
output_row.message = m;
And set processing Mode as  "RawMessage" in tJMSOutput to see if it works?
Best regards
Sabrina
--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.
Highlighted

Re: tJMSOutput body + header

Hi,
It's works !
After tXMLMap, we get a message with Document type .
In tJavaRow we transform message into String type and in our ouput tJavaRow we set message to object type.
javax.jms.TextMessage m = session_tJMSOutput_1.createTextMessage();
m.setText(customers.message.toString());
m.setStringProperty("Action","Update");
output_row.message = m;
An another question Smiley Happy, when I send 2 xml in my queue MQ. When I get the first xml, he is fine but the second is the first one (xml) and the second concatenate.
I need to clear the queue between two sending ?
Best regards,
Loïc

2019 GARTNER MAGIC QUADRANT FOR DATA INTEGRATION TOOL

Talend named a Leader.

Get your copy

OPEN STUDIO FOR DATA INTEGRATION

Kickstart your first data integration and ETL projects.

Download now

An API-First Approach to Modernizing Applications

Learn how to use an API-First Approach to Modernize your Applications

Watch Now

Talend API Designer – Technical Overview

Take a look at this technical overview video of Talend API Designer

Watch Now

Getting Started with APIs

Find out how to get started with APIs

Read