tJMSOutput body + header

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
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.

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

Calling Talend Open Studio Users

The first 100 community members completing the Open Studio survey win a $10 gift voucher.

Start the survey

2019 GARNER 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

What’s New for Talend Summer ’19

Watch the recorded webinar!

Watch 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