You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by pchakinala <pr...@planetsoft.com> on 2012/06/12 16:27:27 UTC

jms to http

Hi,
 We are using SMX 4.4 and Camel 2.8.3. Process flow defined below

http client --->camel-http--> jms queue provider ---> queue consumer --->
http ---> target service

<endpoint id="VendorAsyncQueue"
uri="jms:queue:VendorAsyncQueue?transacted=true&amp;deliveryPersistent=true"/>  

<route>
			<from uri="jetty:http://0.0.0.0:8192/AsyncReq/"/>
			 <setExchangePattern pattern="InOnly"/>
				<to uri="VendorAsyncQueue"/>
	</route>
		<route>
     		<from uri="jms:queue:VendorAsyncQueue"/>
                         <to
uri="http://localhost:8080/nipr.jsp?bridgeEndpoint=true"/> 
		</route>
After consuming the message from queue,it should send it to target  http
service.
However observed http endpoint value is replacing at run time.
http://localhost:8080/nipr.jsp/AsyncReq/
 
Here attached log file for your reference. Please update why http uri value
is replacing at runtime.

http://camel.465427.n5.nabble.com/file/n5714372/servicemix.log
servicemix.log 
http://camel.465427.n5.nabble.com/file/n5714372/beans.xml beans.xml 
Regards,
Praveen Chakinala




--
View this message in context: http://camel.465427.n5.nabble.com/jms-to-http-tp5714372.html
Sent from the Camel - Users mailing list archive at Nabble.com.

RE: jms to http

Posted by pchakinala <pr...@planetsoft.com>.
Hi Wilem,

Thank you for the response. 

Usecase: Need to implement Async Service. So we have used jms queue
(Camel-jms) and camel-http  components.

  Httpclient -- camel-http (<from
uri="jetty:http://0.0.0.0:8192/mib401Asyncreq/"/>)- jms queue provider ---> 
queue consumer --->http  target (http) service

If I don’t use bridgeEndpoint  found below exception.
java.lang.IllegalArgumentException: Invalid uri:
/mib401Asyncreq/mib401Asyncreq/. If you are forwarding/bridging http
endpoints, then enable the bridgeEndpoint option on the endpoint:
Endpoint[http://localhost:8080/jsp-examples/checkbox/nipr.jsp]

If I use bridgeEndpoint found below exception: 
Obesered URL value is changing in the run time and adding first route uri

First route or incoming endpoint :  <from
uri="jetty:http://0.0.0.0:8192/mib401Asyncreq/"/>
To uri: <to
uri="http://localhost:8080/jsp-examples/checkbox/nipr.jsp?bridgeEndpoint=true"/> 
                                                
Changing uri dynamically like below:

        | 100 - org.apache.camel.camel-http - 2.8.3 | Executing http POST
method: http://localhost:8080/jsp-examples/checkbox/nipr.jsp/mib401Asyncreq/

I attached log files and beans xml for your reference. Please suggest me why
the url value is replacing in runtime.

Is this the right way to implement httpJms Bridge? Please suggest
http://camel.465427.n5.nabble.com/file/n5714542/beans.xml.txt beans.xml.txt 
http://camel.465427.n5.nabble.com/file/n5714542/servicemix_log_with_bridgeEndpoint.log
servicemix_log_with_bridgeEndpoint.log 
http://camel.465427.n5.nabble.com/file/n5714542/servicemix_log_without_bridgeEndpoint.log
servicemix_log_without_bridgeEndpoint.log 

--
View this message in context: http://camel.465427.n5.nabble.com/jms-to-http-tp5714372p5714542.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: jms to http

Posted by Willem Jiang <wi...@gmail.com>.
Hi,

You are setting the http endpoint to be bridgeEndpoint which means the 
request url will be updated with request URI.
If you don't need that you can remove the option of bridgeEndpoint.

On Tue Jun 12 22:27:27 2012, pchakinala wrote:
> Hi,
>   We are using SMX 4.4 and Camel 2.8.3. Process flow defined below
>
> http client --->camel-http-->  jms queue provider --->  queue consumer --->
> http --->  target service
>
> <endpoint id="VendorAsyncQueue"
> uri="jms:queue:VendorAsyncQueue?transacted=true&amp;deliveryPersistent=true"/>
>
> <route>
> 			<from uri="jetty:http://0.0.0.0:8192/AsyncReq/"/>
> 			<setExchangePattern pattern="InOnly"/>
> 				<to uri="VendorAsyncQueue"/>
> 	</route>
> 		<route>
>       		<from uri="jms:queue:VendorAsyncQueue"/>
>                           <to
> uri="http://localhost:8080/nipr.jsp?bridgeEndpoint=true"/>
> 		</route>
> After consuming the message from queue,it should send it to target  http
> service.
> However observed http endpoint value is replacing at run time.
> http://localhost:8080/nipr.jsp/AsyncReq/
>
> Here attached log file for your reference. Please update why http uri value
> is replacing at runtime.
>
> http://camel.465427.n5.nabble.com/file/n5714372/servicemix.log
> servicemix.log
> http://camel.465427.n5.nabble.com/file/n5714372/beans.xml beans.xml
> Regards,
> Praveen Chakinala
>
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/jms-to-http-tp5714372.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>



--
Willem
----------------------------------
FuseSource
Web: http://www.fusesource.com
Blog:    http://willemjiang.blogspot.com (English)
         http://jnn.javaeye.com (Chinese)
Twitter: willemjiang
Weibo: willemjiang