Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I eventually created a new component fitting my needs by copying tMOMInput and changing the previous message types by ObjectMessage in the .javajet files.
To understand how the component creation works I read:
https://help.talend.com/search/all?query=How+to+create+a+custom+component
I hope it can help you.
We will consume messages while they continue to be delivered
Exception in component tMomInput3_1
javax.jms.JMSException: Failed to build body from bytes. Reason: java.io.IOException: org.apache.camel.converter.jaxp.StringSource
at org.apache.activemq.util.JMSExceptionSupport.create(JMSExceptionSupport.java:35)
at org.apache.activemq.command.ActiveMQObjectMessage.getObject(ActiveMQObjectMessage.java:183)
at testprojekt.dd_0_1.dd.tMomInput3_1Process(dd.java:452)
at testprojekt.dd_0_1.dd.runJobInTOS(dd.java:817)
at testprojekt.dd_0_1.dd.main(dd.java:684)
Caused by: java.io.IOException: org.apache.camel.converter.jaxp.StringSource
at org.apache.activemq.command.ActiveMQObjectMessage.getObject(ActiveMQObjectMessage.java:179)
... 3 more
disconnected
disconnected
/*-----------------------------------------------------------4.judge message body type---------------------------------------*/
...
if ("Text".equals(msgBobyType)) {
...
} else if ("ActiveMQObjectMessage".equals(msgBobyType)) {
%>
String msg_<%=cid %> = null;
if(message_<%=cid%> instanceof org.apache.activemq.command.ActiveMQObjectMessage) {
msg_<%=cid %> = "";
org.apache.activemq.command.ActiveMQObjectMessage mqmsg_<%=cid %> = (org.apache.activemq.command.ActiveMQObjectMessage) message_<%=cid%>;
if(mqmsg_<%=cid %>.getObject() instanceof org.apache.camel.converter.jaxp.StringSource) {
org.apache.camel.converter.jaxp.StringSource ssmsg_<%=cid %> = (org.apache.camel.converter.jaxp.StringSource) mqmsg_<%=cid %>.getObject();
msg_<%=cid %> = ssmsg_<%=cid %>.getText();
}
} else if (message_<%=cid%> instanceof org.apache.activemq.command.ActiveMQTextMessage) {
org.apache.activemq.command.ActiveMQTextMessage mqmsg_<%=cid %> = (org.apache.activemq.command.ActiveMQTextMessage) message_<%=cid%>;
msg_<%=cid %> = mqmsg_<%=cid %>.getText();
}
<%
}