You are not logged in.
Announcement
Unanswered posts
|
Pages: 1
I'm attempting to create a job like this: tMomInput => tMap => tLogRow that pulls an XML message out of an ActiveMQ JMS message and am having an issue where I get no data coming out in the tLogRow. I've verified that the tMomInput is receiving the message as a TextMessage from MQ. For the Schema settings for the tMomInput I selected 'Repository' and then pointed to a generic schema that I set up based on a simple xml document like this:
<?xml version="1.0" encoding="UTF-8" ?>
<product xmlns="http://www.w3schools.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.w3schools.com product.xsd">
<id>12345</id>
<description>Happy Fun Ball</description>
<cost>1.99</cost>
</product>
The Generic Schema has entries for id, description, and cost which I assume is correct. In the tMap I've mapped across the data from the tMomInput (id, description, cost) over to the tLogRow. Then when I run the job I get this:
Connecting to URL: tcp://172.16.8.100:61616
Consuming queue: blah.blah
We will consume messages while they continue to be delivered
[tLogRow_1] id: |description: |cost:
As you can see the data for the attributes is not pulled from the XML file and displayed. I've verified that the messages are being queued and de-queued in MQ and the job is displaying the messages onscreen going between the components. My guess is that there's something wrong with the definition of the generic schema but am not sure since I'm new to the tool.
Ideas?
Offline
One more thing to note is that when I created this job - that when I switch from Built-in to Repository on the schema on the tMomInput that it creates two errors in the java class that gets built. The java code is there to set the 'from' and the 'message' attribute on the row1Struct class even though this class has the id, description, and cost attributes on it.
while ((message_tMomInput_1 = consumer_tMomInput_1.receive()) != null) {
javax.jms.TextMessage txtMsg_tMomInput_1 = (javax.jms.TextMessage) message_tMomInput_1;
String msg_tMomInput_1 = txtMsg_tMomInput_1.getText();
row1.from = "CHOO.CHOO"; //error here
row1.message = msg_tMomInput_1; //error here
When I created another job and used "Built-in" instead of "Repository" then the above code is right - the row1Struct class has the two attributes specified above. So it looks like possibly the ActiveMQ tMomInput code generation has issues? Or is it related to the Generic Schema I selected. Hope the more information sheds some light.
Offline

I dont have an ActiveMQ here to test this out with, but I believe that you need to leave the from and message in the tMomInput schema, just try mapping those two fields to a tLogRow and see if you get data. The message should be the full xml message (the payload). If you do get the xml in the message field, you will then use a tXMLParseField component to parse that xml into the fields that you were expecting. You will need to specify a loop xpath and which fields you want. (e.g. loop on /product fields ./id ./description ./cost)
Let us know how that works and we'll go from there.
Best,
Thomas
Offline
Pages: 1