• Index
  •  » Talend Open Studio for Data Integration » Usage, Operation
  •  » problems using tMomInput with Message Body Type = Map Message

#1 2010-01-12 21:40:28

aheinz
New member
Company: Lulu.com
Registered: 2009-12-03
Posts: 7

problems using tMomInput with Message Body Type = Map Message

My initial prototype using a tMomInput with Message Body Type = Text Message was successful.  Since we plan to pass multi-valued messages, now I'm prototyping Message Body Type = Map Message, but without success.  You can see that my AMQ message is JMS, with JSON-encoded product_id.

[aheinz@aheinz activemq]$ sudo ./bin/activemq-admin browse --amqurl tcp://localhost:61616 product.changed
Java Runtime: Sun Microsystems Inc. 1.5.0_04 /usr/lib/jvm/java-1.5.0.04/jre
  Heap sizes: current=1984k  free=1628k  max=65088k
    JVM args: -Dactivemq.classpath=/opt/activemq/conf; -Dactivemq.home=/opt/activemq -Dactivemq.base=/opt/activemq
ACTIVEMQ_HOME: /opt/activemq
ACTIVEMQ_BASE: /opt/activemq
JMS_CUSTOM_FIELD:transformation-error = product_id : product_id
JMS_CUSTOM_FIELD:transformation = jms-map-json
JMS_HEADER_FIELD:JMSDestination = product.changed
JMS_BODY_FIELD:JMSText = {"product_id":5478688}
JMS_HEADER_FIELD:JMSDeliveryMode = non-persistent
JMS_HEADER_FIELD:JMSMessageID = ID:aheinz-49598-1263325250665-4:10:-1:1:1
JMS_HEADER_FIELD:JMSExpiration = 0
JMS_HEADER_FIELD:JMSPriority = 0
JMS_HEADER_FIELD:JMSRedelivered = false
JMS_HEADER_FIELD:JMSTimestamp = 1263327856169

But when I run the job after reconfiguring as a map message, it fails trying to cast an ActiveMQTextMessage to a MapMessage.

Starting job ProductMessage at 15:21 12/01/2010.
[statistics] connecting to socket on port 3441
[statistics] connected
Connecting to URL: tcp://localhost:61616
Consuming queue: product.changed
We will consume messages while they continue to be delivered
Exception in component tMomInput_1
java.lang.ClassCastException: org.apache.activemq.command.ActiveMQTextMessage
    at lulu_etl.productmessage_0_1.ProductMessage.tMomInput_1Process(ProductMessage.java:355)
    at lulu_etl.productmessage_0_1.ProductMessage.runJobInTOS(ProductMessage.java:601)
    at lulu_etl.productmessage_0_1.ProductMessage.main(ProductMessage.java:494)

[statistics] disconnected
Job ProductMessage ended at 15:21 12/01/2010. [exit code=1]

Ideas?  Is this a bug, or a misconfiguration on my part?

Offline

#2 2010-01-12 21:44:53

aheinz
New member
Company: Lulu.com
Registered: 2009-12-03
Posts: 7

Re: problems using tMomInput with Message Body Type = Map Message

[screenshot of job]


Uploaded Images

Offline

#3 2010-01-13 04:22:30

shong
Talend team
Registered: 2007-08-29
Posts: 10310
Website

Re: problems using tMomInput with Message Body Type = Map Message

Hello

java.lang.ClassCastException: org.apache.activemq.command.ActiveMQTextMessage

There should be a bug, we will refactor tMomxxx component, see [Bugtracker, feature 6112, fixed] Refactor tMom components. Please add a note on this feature or report a new bug on our bugtracker.

Best regards

          shong


Email:shong@talend.com
Choose Talend, Enjoy Talend!
New & Event: Talend Help Center
Talend-->the leader of open source data management and application integration solutions!

Offline

#4 2010-01-21 17:27:33

aheinz
New member
Company: Lulu.com
Registered: 2009-12-03
Posts: 7

Re: problems using tMomInput with Message Body Type = Map Message

map message created by StompMessageMap in PHP:
JMS_CUSTOM_FIELD:transformation-error = product_id : product_id
JMS_CUSTOM_FIELD:transformation = jms-map-json
JMS_HEADER_FIELD:JMSDestination = product.changed
JMS_BODY_FIELD:JMSText = {"product_id":5478688}
JMS_HEADER_FIELD:JMSDeliveryMode = non-persistent
JMS_HEADER_FIELD:JMSMessageID = ID:aheinz.rdu.lulu.com-40204-1263845710959-4:4:-1:1:1
JMS_HEADER_FIELD:JMSExpiration = 0
JMS_HEADER_FIELD:JMSPriority = 0
JMS_HEADER_FIELD:JMSRedelivered = false
JMS_HEADER_FIELD:JMSTimestamp = 1264088710853

map message created by tMomOutput
JMS_HEADER_FIELD:JMSExpiration = 0
JMS_HEADER_FIELD:JMSMessageID = ID:aheinz.rdu.lulu.com-42800-1264088975819-0:0:1:1:1
JMS_HEADER_FIELD:JMSPriority = 4
JMS_HEADER_FIELD:JMSDestination = product.changed
JMS_HEADER_FIELD:JMSTimestamp = 1264088976327
JMS_HEADER_FIELD:JMSDeliveryMode = non-persistent
JMS_HEADER_FIELD:JMSRedelivered = false

Reading the 1.1 specification (http://java.sun.com/products/jms/docs.html), it doesn't appear to demand any particular message implementation on the wire.  Further reading on the subject suggests that JMS interoperability problems are not uncommon.  Talend is using org.apache.activemq Java classes and STOMP purports to be a JMS client for ActiveMQ.  I'll keep looking.

Offline

#5 2010-01-21 17:40:03

aheinz
New member
Company: Lulu.com
Registered: 2009-12-03
Posts: 7

Re: problems using tMomInput with Message Body Type = Map Message

aheinz wrote:

Talend is using org.apache.activemq Java classes

Or perhaps not; it looks like javax.jms.MessageProducer is being used to create the actual message.

Offline

#6 2010-01-21 17:51:29

aheinz
New member
Company: Lulu.com
Registered: 2009-12-03
Posts: 7

Re: problems using tMomInput with Message Body Type = Map Message

aheinz wrote:

Or perhaps not; it looks like javax.jms.MessageProducer is being used to create the actual message.

Scratch that, javax.jms.MessageProducer is an interface that org.apache.activemq factories are creating instances of.

Offline

  • Index
  •  » Talend Open Studio for Data Integration » Usage, Operation
  •  » problems using tMomInput with Message Body Type = Map Message

Board footer

Powered by FluxBB