You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@servicemix.apache.org by ykj <yk...@163.com> on 2007/03/25 15:51:16 UTC

problems when jms post infomation to http component

hello ,everyone 
         I am a new servicemixguy. I can run the bridge example
successfully.now. I want to send  the 
message by jms ,then get it from  httpComponet? I write  the flows,but it
does't successfully.
    jms - jsr181-httpcomponent.
1.jms 'xbean.xml
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns:jms="http://servicemix.apache.org/jms/1.0" 
  <jms:endpoint service="b:Request_in"
                endpoint="Request_in"
				targetEndpoint="Request_out"
				                role="consumer" 				
                destinationStyle="queue"
				targetService="b:Request_out"
                jmsProviderDestinationName="UII_Request_in"
                connectionFactory="#connectionFactory" 
				defaultMep="http://www.w3.org/2004/08/wsdl/in-only"/>
                
  <bean id="connectionFactory"
class="org.apache.activemq.ActiveMQConnectionFactory">
    <property name="brokerURL" value="tcp://localhost:61616" />
  </bean>
  				   
</beans>


jsr181's xbean.xml:
<beans xmlns:jsr181="http://servicemix.apache.org/jsr181/1.0">

    <jsr181:endpoint
pojoClass="org.apache.servicemix.samples.wsdl_first.PersonImpl"
                     wsdlResource="classpath:person.wsdl"
                     style="document"/>

</beans>
httpcomponent's xbean.xml

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns:http="http://servicemix.apache.org/http/1.0"
	       xmlns:b="http://servicemix.apache.org/samples/UII">

  <http:endpoint service="b:Request_out"
                 endpoint="Request_out"
				         role="consumer" 
				 soap="true"
				 locationURI="http://0.0.0.0:8192/PersonService/"
                 defaultMep="http://www.w3.org/2004/08/wsdl/in-only"
                 soapAction="getPerson"/> 
</beans>
jms  act  as  provider role. httpcomponent act as cosumer role.in the
httpComponent ,the
locationURl is  http://0.0.0.0:8192/PersonService/  .jsr181 make it as
avaiable service.
when  I  test, i  send the message in  UII_Request_in, I want to receive the
message in  http://0.0.0.0:8192/PersonService/.but i fail.
   I  need the help from you. thank you in advances.
-- 
View this message in context: http://www.nabble.com/problems--when-jms-post-infomation-to--http-component-tf3462390s12049.html#a9660049
Sent from the ServiceMix - User mailing list archive at Nabble.com.


Re: problems when jms post infomation to http component

Posted by Adrian Co <ac...@exist.com>.
You can't send a jms request to an http component, because the protocol 
they are using is different.

You can send to a jms message to an jms consumer and route it to the 
jsr181 component.

or you could send a jms message to a jms consumer, route it to an http 
provider that is targeted at

http://0.0.0.0:8192/PersonService/

so the flow would be jms message->jms consumer->http provider->http 
consumer->jsr181 su

Hope that helps.

ykj wrote:
> hello ,everyone 
>          I am a new servicemixguy. I can run the bridge example
> successfully.now. I want to send  the 
> message by jms ,then get it from  httpComponet? I write  the flows,but it
> does't successfully.
>     jms - jsr181-httpcomponent.
> 1.jms 'xbean.xml
> <?xml version="1.0" encoding="UTF-8"?>
> <beans xmlns:jms="http://servicemix.apache.org/jms/1.0" 
>   <jms:endpoint service="b:Request_in"
>                 endpoint="Request_in"
> 				targetEndpoint="Request_out"
> 				                role="consumer" 				
>                 destinationStyle="queue"
> 				targetService="b:Request_out"
>                 jmsProviderDestinationName="UII_Request_in"
>                 connectionFactory="#connectionFactory" 
> 				defaultMep="http://www.w3.org/2004/08/wsdl/in-only"/>
>                 
>   <bean id="connectionFactory"
> class="org.apache.activemq.ActiveMQConnectionFactory">
>     <property name="brokerURL" value="tcp://localhost:61616" />
>   </bean>
>   				   
> </beans>
>
>
> jsr181's xbean.xml:
> <beans xmlns:jsr181="http://servicemix.apache.org/jsr181/1.0">
>
>     <jsr181:endpoint
> pojoClass="org.apache.servicemix.samples.wsdl_first.PersonImpl"
>                      wsdlResource="classpath:person.wsdl"
>                      style="document"/>
>
> </beans>
> httpcomponent's xbean.xml
>
> <?xml version="1.0" encoding="UTF-8"?>
> <beans xmlns:http="http://servicemix.apache.org/http/1.0"
> 	       xmlns:b="http://servicemix.apache.org/samples/UII">
>
>   <http:endpoint service="b:Request_out"
>                  endpoint="Request_out"
> 				         role="consumer" 
> 				 soap="true"
> 				 locationURI="http://0.0.0.0:8192/PersonService/"
>                  defaultMep="http://www.w3.org/2004/08/wsdl/in-only"
>                  soapAction="getPerson"/> 
> </beans>
> jms  act  as  provider role. httpcomponent act as cosumer role.in the
> httpComponent ,the
> locationURl is  http://0.0.0.0:8192/PersonService/  .jsr181 make it as
> avaiable service.
> when  I  test, i  send the message in  UII_Request_in, I want to receive the
> message in  http://0.0.0.0:8192/PersonService/.but i fail.
>    I  need the help from you. thank you in advances.
>   


Re: problems when jms post infomation to http component

Posted by Adrian Co <ac...@exist.com>.
Hi,

You cant send a jms message to an http endpoint directly.

What you would do is to send a jms message to a jms destination (topic 
or queue), consume that from a jms consumer, which will send a 
normalized message to the service it is proxying for. which in this case 
you would want to be an http provider. The http provider will then 
create an http request (soap or otherwise) containing the normalized 
message and send it over to the location uri, which is being listened to 
by the http consumer.

"I design  the flow  route like this
              jms consumer --httpprovider---httpconsumer
it can't work.do you have some experiences for this ,I really need help ."

What do you mean it can't work?



ykj wrote:
> the first  try:
> I design  the flow  route like this
>                jms provider -----jms consumer --httpprovider---httpconsumer
> until now  with jms provider ---- jms  consumer  process and  httpprovider
> ---- httpconsumer process they  works,
> but              jms provider -----jms consumer
> --httpprovider---httpconsumer  process  does'nt works.
>
> there are  xbean.xml and jbi.xml for  four   su.can you help me?
>
> 1.jms-in
>
> <?xml version="1.0" encoding="UTF-8"?>
> <beans xmlns:jms="http://servicemix.apache.org/jms/1.0"
>        xmlns:b="http://servicemix.apache.org/samples/MTA">
>
>   <jms:endpoint service="b:jms_in"
>                 endpoint="jms_in"
> 			        	targetEndpoint="jms_out"
>                 role="consumer" 				
>                 destinationStyle="queue"
> 			        	targetService="b:jms_out"
>                 jmsProviderDestinationName="MTA_Request_in"
>                 connectionFactory="#connectionFactory" 
> 				defaultMep="http://www.w3.org/2004/08/wsdl/in-out"/>
>                 
>   <bean id="connectionFactory"
> class="org.apache.activemq.ActiveMQConnectionFactory">
>     <property name="brokerURL" value="tcp://localhost:61616" />
>   </bean>
>   				   
> </beans>
> 2.jms-out
> <?xml version="1.0" encoding="UTF-8"?>
> <beans xmlns:jms="http://servicemix.apache.org/jms/1.0"
>        xmlns:b="http://servicemix.apache.org/samples/MTA">
>
>   <jms:endpoint service="b:jms_out"
>                 endpoint="jms_out"
>                 role="provider" 	
>                 targetEndpoint="Request_in"			
>                 destinationStyle="queue"
>                 jmsProviderDestinationName="MTA_Request_out"
>                 connectionFactory="#connectionFactory" 
> 				defaultMep="http://www.w3.org/2004/08/wsdl/in-out"/>
>                 
>   <bean id="connectionFactory"
> class="org.apache.activemq.ActiveMQConnectionFactory">
>     <property name="brokerURL" value="tcp://localhost:61616" />
>   </bean>
>   				   
> </beans>
> 3.httpprovider
>
> <?xml version="1.0" encoding="UTF-8"?>
> <beans xmlns:http="http://servicemix.apache.org/http/1.0"
>        xmlns:b="http://servicemix.apache.org/samples/MTA">
>
>   <http:endpoint service="b:Request_in"
>                  endpoint="Request_in"
>                  targetService="b:Request_out"
>                  role="consumer" 
>                  locationURI="http://0.0.0.0:8191/bridge/"
>                  defaultMep="http://www.w3.org/2004/08/wsdl/in-only" />
>
> </beans>
> 4.httpconsumer
> <?xml version="1.0" encoding="UTF-8"?>
> <beans xmlns:http="http://servicemix.apache.org/http/1.0"
>        xmlns:b="http://servicemix.apache.org/samples/MTA">
>
>   <http:endpoint service="b:Request_out"
>                  endpoint="Request_out"
>                  role="provider" 
>                  locationURI="http://0.0.0.0:8192/PersonService/"/> 
> 			
>
> </beans>
>
> when  I send  the  message to queue MTA_Request_in,I can't  receive any
> message in  http://0.0.0.0:8192/PersonService/. I  run the wsdl-first ,so 
> http://0.0.0.0:8192/PersonService/  this service works.
>
>
> the second  try:
>
> I design  the flow  route like this
>               jms consumer --httpprovider---httpconsumer
> it can't work.do you have some experiences for this ,I really need help .
> thanks in advance
>
>
>  
>
>
>
>   


Re: problems when jms post infomation to http component

Posted by ykj <yk...@163.com>.

the first  try:
I design  the flow  route like this
               jms provider -----jms consumer --httpprovider---httpconsumer
until now  with jms provider ---- jms  consumer  process and  httpprovider
---- httpconsumer process they  works,
but              jms provider -----jms consumer
--httpprovider---httpconsumer  process  does'nt works.

there are  xbean.xml and jbi.xml for  four   su.can you help me?

1.jms-in

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns:jms="http://servicemix.apache.org/jms/1.0"
       xmlns:b="http://servicemix.apache.org/samples/MTA">

  <jms:endpoint service="b:jms_in"
                endpoint="jms_in"
			        	targetEndpoint="jms_out"
                role="consumer" 				
                destinationStyle="queue"
			        	targetService="b:jms_out"
                jmsProviderDestinationName="MTA_Request_in"
                connectionFactory="#connectionFactory" 
				defaultMep="http://www.w3.org/2004/08/wsdl/in-out"/>
                
  <bean id="connectionFactory"
class="org.apache.activemq.ActiveMQConnectionFactory">
    <property name="brokerURL" value="tcp://localhost:61616" />
  </bean>
  				   
</beans>
2.jms-out
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns:jms="http://servicemix.apache.org/jms/1.0"
       xmlns:b="http://servicemix.apache.org/samples/MTA">

  <jms:endpoint service="b:jms_out"
                endpoint="jms_out"
                role="provider" 	
                targetEndpoint="Request_in"			
                destinationStyle="queue"
                jmsProviderDestinationName="MTA_Request_out"
                connectionFactory="#connectionFactory" 
				defaultMep="http://www.w3.org/2004/08/wsdl/in-out"/>
                
  <bean id="connectionFactory"
class="org.apache.activemq.ActiveMQConnectionFactory">
    <property name="brokerURL" value="tcp://localhost:61616" />
  </bean>
  				   
</beans>
3.httpprovider

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns:http="http://servicemix.apache.org/http/1.0"
       xmlns:b="http://servicemix.apache.org/samples/MTA">

  <http:endpoint service="b:Request_in"
                 endpoint="Request_in"
                 targetService="b:Request_out"
                 role="consumer" 
                 locationURI="http://0.0.0.0:8191/bridge/"
                 defaultMep="http://www.w3.org/2004/08/wsdl/in-only" />

</beans>
4.httpconsumer
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns:http="http://servicemix.apache.org/http/1.0"
       xmlns:b="http://servicemix.apache.org/samples/MTA">

  <http:endpoint service="b:Request_out"
                 endpoint="Request_out"
                 role="provider" 
                 locationURI="http://0.0.0.0:8192/PersonService/"/> 
			

</beans>

when  I send  the  message to queue MTA_Request_in,I can't  receive any
message in  http://0.0.0.0:8192/PersonService/. I  run the wsdl-first ,so 
http://0.0.0.0:8192/PersonService/  this service works.


the second  try:

I design  the flow  route like this
              jms consumer --httpprovider---httpconsumer
it can't work.do you have some experiences for this ,I really need help .
thanks in advance


 



-- 
View this message in context: http://www.nabble.com/problems--when-jms-post-infomation-to--http-component-tf3462390s12049.html#a9732509
Sent from the ServiceMix - User mailing list archive at Nabble.com.