You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@servicemix.apache.org by mqadeer <qa...@yahoo.com> on 2006/07/27 12:54:37 UTC
http to jms message transformation
hi, I am new to servicemix. I want to do the following:
1. Component1 is httpbinding component that receives request from http
client.
2. Component2 receives the message through JMS bus
3. Component3 also receives JMS message
4. Response is sent back to http client.
Do I need to transform http message into jms before component 2 receives it?
please see servicemix.xml file below. for simplicity, say if there is a
component2 in http-binding example, how would it receive message from
httpReceiver? Or what changes should be made if in loan-broker example,
Lender Gateway has http binding?
mqadeer
servicemix.xml
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://xbean.org/schemas/spring/1.0"
xmlns:spring="http://xbean.org/schemas/spring/1.0"
xmlns:sm="http://servicemix.org/config/1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xbean.org/schemas/spring/1.0
../../conf/spring-beans.xsd
http://servicemix.org/config/1.0
../../conf/servicemix.xsd"
xmlns:my="http://servicemix.org/demo/">
<!-- the JBI container -->
<sm:container spring:id="jbi"
useMBeanServer="true"
createMBeanServer="true"
dumpStats="true"
statsInterval="10">
<sm:activationSpecs>
<!-- Create a http server binding on port 8912 and have it forward to -->
<sm:activationSpec componentName="httpReceiver"
service="my:httpBinding"
endpoint="httpReceiver"
destinationService="my:stockQuote">
<sm:component>
<bean xmlns="http://xbean.org/schemas/spring/1.0"
class="org.servicemix.components.http.HttpConnector">
<property name="host" value="localhost"/>
<property name="port" value="8912"/>
</bean>
</sm:component>
</sm:activationSpec>
<!--
<sm:activationSpec componentName="inputSender"
service="my:inputSender">
<sm:component>
<bean xmlns="http://xbean.org/schemas/spring/1.0"
class="org.servicemix.components.jms.JmsSenderComponent">
<property name="template">
<bean
class="org.springframework.jms.core.JmsTemplate">
<property name="connectionFactory">
<ref local="jmsFactory" />
</property>
<property name="defaultDestinationName"
value="demo.org.servicemix.source" />
<property name="pubSubDomain"
value="true" />
</bean>
</property>
</bean>
</sm:component>
</sm:activationSpec>
<sm:activationSpec componentName="inputReceiver"
service="my:inputReceiver">
<sm:component>
<bean xmlns="http://xbean.org/schemas/spring/1.0"
class="org.servicemix.components.jms.JmsInUsingJCABinding">
<property name="jcaContainer" ref="jencks" />
<property name="activationSpec">
<bean
class="org.activemq.ra.ActiveMQActivationSpec">
<property name="destination"
value="demo.org.servicemix.source" />
<property name="destinationType"
value="javax.jms.Topic" />
</bean>
</property>
</bean>
</sm:component>
</sm:activationSpec> -->
</sm:activationSpecs>
</sm:container>
<!-- the JCA container -->
<bean id="jencks" class="org.jencks.JCAContainer" singleton="true">
<!-- lets use the default configuration of work manager and transaction
manager-->
<property name="bootstrapContext">
<bean class="org.jencks.factory.BootstrapContextFactoryBean">
<property name="threadPoolSize" value="25"/>
</bean>
</property>
<!-- the JCA Resource Adapter -->
<property name="resourceAdapter">
<bean id="activeMQResourceAdapter"
class="org.activemq.ra.ActiveMQResourceAdapter" singleton="true">
<property name="serverUrl" value="tcp://localhost:61616"/>
</bean>
</property>
</bean>
<bean id="transactionContextManager"
class="org.jencks.factory.TransactionContextManagerFactoryBean"/>
<bean id="transactionManager"
class="org.jencks.factory.GeronimoTransactionManagerFactoryBean" />
<bean id="jmsFactory" class="org.activemq.pool.PooledConnectionFactory">
<property name="connectionFactory">
<bean class="org.activemq.ActiveMQConnectionFactory">
<property name="brokerURL">
<value>tcp://localhost:61616</value>
</property>
</bean>
</property>
</bean>
</beans>
--
View this message in context: http://www.nabble.com/http-to-jms-message-transformation-tf2008896.html#a5518883
Sent from the ServiceMix - User forum at Nabble.com.
Re: http to jms message transformation
Posted by Guillaume Nodet <gn...@gmail.com>.
You need to redirect the output of the http receiver to the jms sender.
The target of jbi exchanges sent by the http receiver is identified by
the targetService attribute, which should match the one from the jms
sender.
Then all subscribers on the topic should be able to receive the jms message.
Cheers,
Guillaume Nodet
On 7/27/06, mqadeer <qa...@yahoo.com> wrote:
>
>
> hi, I am new to servicemix. I want to do the following:
>
> 1. Component1 is httpbinding component that receives request from http
> client.
> 2. Component2 receives the message through JMS bus
> 3. Component3 also receives JMS message
> 4. Response is sent back to http client.
>
> Do I need to transform http message into jms before component 2 receives
> it?
> please see servicemix.xml file below. for simplicity, say if there is a
> component2 in http-binding example, how would it receive message from
> httpReceiver? Or what changes should be made if in loan-broker example,
> Lender Gateway has http binding?
>
> mqadeer
>
> servicemix.xml
>
> <?xml version="1.0" encoding="UTF-8"?>
> <beans xmlns="http://xbean.org/schemas/spring/1.0"
> xmlns:spring="http://xbean.org/schemas/spring/1.0"
> xmlns:sm="http://servicemix.org/config/1.0"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xsi:schemaLocation="http://xbean.org/schemas/spring/1.0
> ../../conf/spring-beans.xsd
> http://servicemix.org/config/1.0
> ../../conf/servicemix.xsd"
> xmlns:my="http://servicemix.org/demo/">
>
> <!-- the JBI container -->
> <sm:container spring:id="jbi"
> useMBeanServer="true"
> createMBeanServer="true"
> dumpStats="true"
> statsInterval="10">
>
> <sm:activationSpecs>
>
> <!-- Create a http server binding on port 8912 and have
> it forward to -->
> <sm:activationSpec componentName="httpReceiver"
>
> service="my:httpBinding"
> endpoint="httpReceiver"
>
> destinationService="my:stockQuote">
> <sm:component>
> <bean xmlns="http://xbean.org/schemas/spring/1.0"
> class="
> org.servicemix.components.http.HttpConnector">
> <property name="host" value="localhost"/>
> <property name="port" value="8912"/>
> </bean>
> </sm:component>
> </sm:activationSpec>
>
> <!--
> <sm:activationSpec componentName="inputSender"
> service="my:inputSender">
> <sm:component>
> <bean xmlns="
> http://xbean.org/schemas/spring/1.0"
> class="
> org.servicemix.components.jms.JmsSenderComponent">
> <property name="template">
> <bean
> class="
> org.springframework.jms.core.JmsTemplate">
> <property
> name="connectionFactory">
> <ref
> local="jmsFactory" />
> </property>
> <property
> name="defaultDestinationName"
> value="
> demo.org.servicemix.source" />
> <property
> name="pubSubDomain"
> value="true" />
> </bean>
> </property>
> </bean>
> </sm:component>
> </sm:activationSpec>
>
> <sm:activationSpec componentName="inputReceiver"
> service="my:inputReceiver">
> <sm:component>
> <bean xmlns="
> http://xbean.org/schemas/spring/1.0"
> class="
> org.servicemix.components.jms.JmsInUsingJCABinding">
> <property
> name="jcaContainer" ref="jencks" />
> <property
> name="activationSpec">
> <bean
> class="
> org.activemq.ra.ActiveMQActivationSpec">
> <property
> name="destination"
>
> value="
> demo.org.servicemix.source" />
> <property
> name="destinationType"
>
> value="
> javax.jms.Topic" />
> </bean>
> </property>
> </bean>
> </sm:component>
> </sm:activationSpec> -->
>
>
> </sm:activationSpecs>
> </sm:container>
>
>
> <!-- the JCA container -->
> <bean id="jencks" class="org.jencks.JCAContainer" singleton="true">
>
> <!-- lets use the default configuration of work manager and
> transaction
> manager-->
> <property name="bootstrapContext">
> <bean class="org.jencks.factory.BootstrapContextFactoryBean">
> <property name="threadPoolSize" value="25"/>
> </bean>
> </property>
>
> <!-- the JCA Resource Adapter -->
> <property name="resourceAdapter">
> <bean id="activeMQResourceAdapter"
> class="org.activemq.ra.ActiveMQResourceAdapter" singleton="true">
> <property name="serverUrl" value="tcp://localhost:61616"/>
> </bean>
> </property>
> </bean>
>
> <bean id="transactionContextManager"
> class="org.jencks.factory.TransactionContextManagerFactoryBean"/>
> <bean id="transactionManager"
> class="org.jencks.factory.GeronimoTransactionManagerFactoryBean" />
>
> <bean id="jmsFactory" class="org.activemq.pool.PooledConnectionFactory">
> <property name="connectionFactory">
> <bean class="org.activemq.ActiveMQConnectionFactory">
> <property name="brokerURL">
> <value>tcp://localhost:61616</value>
> </property>
> </bean>
> </property>
> </bean>
>
> </beans>
>
> --
> View this message in context:
> http://www.nabble.com/http-to-jms-message-transformation-tf2008896.html#a5518883
> Sent from the ServiceMix - User forum at Nabble.com.
>
>
--
Cheers,
Guillaume Nodet