You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by "sanjay.gautam" <sa...@gmail.com> on 2016/01/15 04:02:14 UTC

Exchange has SOAPMessage want to Send to JMS Topic

I am new to the Camel world and what I am trying to do is as follows. 

1. There is a route which is Servlet Component  which is called by external
System. 
2. MyServlet CamelComponent Reads the incoming exchange and creates the
SOAPMessage.
3. In Next Step I want to send the SOAP message to JMS Topic. 

 <bean id="jmsConnectionFactory" 
   class="org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory">
   		<constructor-arg  name="url" value="tcp://localhost:9161" />
      	<constructor-arg  name="user" value="admin" />
        <constructor-arg  name="password" value="password" />
  </bean>

 <bean id="jmsConfig" 
   class="org.apache.camel.component.jms.JmsConfiguration">
   <property name="connectionFactory" ref="jmsConnectionFactory"/>
   <property name="concurrentConsumers" value="1"/>
</bean>

<bean id="activemq"
class="org.apache.activemq.camel.component.ActiveMQComponent">
   <property name="configuration" ref="jmsConfig"/>
</bean>

JMS ROUTE 
At this point I Have a Exchange with SOAPMessage into it and as per the SOAP
documentation I should be able to send SOAP message via JMS , but as per
document  JMS can take only few types ?
I was expecting that CAMEL might have some internal Converter like  
MessageTransformer.SOAPMessageIntoJMSMessage(soapMessage, session);
which help in converting the message . I tried Spring Converter but it
doesnt not convert actually. 

<route id="jmsroute">
        
        <from   uri="direct:jmsDirect"/>
        <log message=" jmsDirect  .... "/>
        <to
uri="activemq:topic:exampleTopic?messageConverter=#jmsMsgConverter"  
pattern="InOnly" />
        
        <transform>
                <constant>OK</constant>
        </transform>
        <log message=" Processing Done Going to Marshal The Object  .... "/>
          
         
        <onException>
            <exception>java.lang.Exception</exception>
            <log message="Exception occured ${exception.message}"/>
            <to uri="bean:exceptionHandler"/>
        </onException>
        <log message="Route staxBroadcastRequestProcessRoute COMPLETED. ....
" loggingLevel="DEBUG"/>
    </route>

Please suggest me any option , I can surely unmarshel and get the details
form the SOAP message but i dont want to do that as that is not our
requirement. we dont need to looking into the message 

thanks
Sanjay G 






--
View this message in context: http://camel.465427.n5.nabble.com/Exchange-has-SOAPMessage-want-to-Send-to-JMS-Topic-tp5776268.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Exchange has SOAPMessage want to Send to JMS Topic

Posted by Willem Jiang <wi...@gmail.com>.
If you can treat the SOAPMessage as a stream, you can just redirect this stream to the JMS topic without doing anything more.

--  
Willem Jiang


Blog: http://willemjiang.blogspot.com (English)  
http://jnn.iteye.com (Chinese)
Twitter: willemjiang  
Weibo: 姜宁willem



On January 15, 2016 at 2:54:02 PM, sanjay.gautam (sanjay.gautam@gmail.com) wrote:
> I am new to the Camel world and what I am trying to do is as follows.
>  
> 1. There is a route which is Servlet Component which is called by external
> System.
> 2. MyServlet CamelComponent Reads the incoming exchange and creates the
> SOAPMessage.
> 3. In Next Step I want to send the SOAP message to JMS Topic.
>  
> > class="org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory">  
>  
>  
>  
>  
>  
> > class="org.apache.camel.component.jms.JmsConfiguration">
>  
>  
>  
>  
> > class="org.apache.activemq.camel.component.ActiveMQComponent">
>  
>  
>  
> JMS ROUTE
> At this point I Have a Exchange with SOAPMessage into it and as per the SOAP
> documentation I should be able to send SOAP message via JMS , but as per
> document JMS can take only few types ?
> I was expecting that CAMEL might have some internal Converter like
> MessageTransformer.SOAPMessageIntoJMSMessage(soapMessage, session);
> which help in converting the message . I tried Spring Converter but it
> doesnt not convert actually.
>  
>  
>  
>  
>  
> > uri="activemq:topic:exampleTopic?messageConverter=#jmsMsgConverter"
> pattern="InOnly" />
>  
>  
> OK
>  
>  
>  
>  
>  
> java.lang.Exception
>  
>  
>  
>  
>  
>  
> Please suggest me any option , I can surely unmarshel and get the details
> form the SOAP message but i dont want to do that as that is not our
> requirement. we dont need to looking into the message
>  
> thanks
> Sanjay G
>  
>  
>  
>  
>  
>  
> --
> View this message in context: http://camel.465427.n5.nabble.com/Exchange-has-SOAPMessage-want-to-Send-to-JMS-Topic-tp5776268.html  
> Sent from the Camel - Users mailing list archive at Nabble.com.
>