Request using camel-cxf:rsClient / membrane proxy to remote server

92 views
Skip to first unread message

80edays....@gmail.com

unread,
Nov 9, 2015, 7:08:48 AM11/9/15
to membrane-monitor



Hello, 
I attended the Camel seminar given by Mr. Tobias Polley at the OIO institute in Mannheim and have the following situation running karaf 3.0.1 with camel 2.13.2.

Defining the following in my context file:

<bean

  <camel-cxf:rsClient

      id="clientRegister"

      address="http://credita.staging.com2-gmbh.de/mydata"

      serviceClass="NewCustomerOrder"

      loggingFeatureEnabled="true" />

</bean>

<route>

  <from uri="activemqEndpoint:topic:mytopic" />

  <to uri="cxfrs://bean://clientRegister?exchangePattern=InOut&amp;dataFormat=PAYLOAD" />

</route>


and then sending the REST call to the remote server, I am never receiving a reply from that same server.

In order to investigate this, I was adviced using the membrane service proxy for watching the traffic.

I did the following:

1) installation of Membrane Service Proxy 4.0.18 and run it on windows.


2) modification of proxies.xml file such as:

<spring:beans ... >
   
<router>
       
<serviceProxy port="80">
<rewriter>
<map from="/(.*)" to="/mydata" />
</rewriter>
<target host="credita.staging.com2-gmbh.de" />
</serviceProxy>
<serviceProxy name="Admin Console" port="9000">
<basicAuthentication>
<user name="admin" password="membrane" />
</basicAuthentication>
<adminConsole />
</serviceProxy>
 
</router>

</spring:beans>

3) starting the admin console using localhost:9000/admin shows:


and



4) To be sure I have the configuration right for the Membrane Service Proxy, I setup a Firefox REST client and sent a request in json from there:



I got an OK as a response, but the Membrane Service Proxy was not delivering anything to the remote server.

First, I would like to have your expertiese on the issue of why Membrane does not react ( I guess it is a configuration issue ).

Second, do you see any wrongdoing when setting up the REST client with Camel in the context file

Thank you very much for your expertiese

With kind regards
Markus Doessegger

Tobias Polley

unread,
Nov 9, 2015, 7:22:05 AM11/9/15
to membrane-monitor
Hi Markus,

the REST request should be sent to http://localhost:80/anything (port 80) instead of port 9000. Port 9000 is for monitoring only.

Try this using the Firefox REST client. You should then be able to monitor the calls in the admin tab.

Then use http://localhost/mydata as your address in the rsClient and monitor the real data.

Please let me know if this doesn't work.

Best, Tobias

Markus Doessegger

unread,
Nov 9, 2015, 10:20:54 AM11/9/15
to membrane-monitor
Hi Tobias,

Ok, this worked now with the Firefox REST client, I see the request/reponse to/from the remote server in Membrane http://localhost:9000/admin/call?id=1963931667 and of course also in the Firefox REST client.

I try to do the same with my karaf server that I have installed on my localhost.


I will insert a
  <log message="####### RECEIVED-CUSTOMER-REPLY: ${body}"/>
next to 
  <to uri="cxfrs://bean://clientRegisterCustomerOrder?exchangePattern=InOut&amp;dataFormat=PAYLOAD"/>


When I am right, this should then print out the reply body, correct? Or do you suggest another method of getting out the reply?

I will let you know when I am there. Thanks so far for your help with this issue.

Best regards
Markus

Markus Doessegger

unread,
Nov 9, 2015, 10:24:50 AM11/9/15
to membrane-monitor
Hi Topias,

The rquest/response was sent/received by Membrane.

In the meantime I have expanded my route in the context with a call to a bean next to the REST client request as followed:

<route>

  <from uri="activemqEndpoint:topic:mytopic" />

  <to uri="cxfrs://bean://clientRegister?exchangePattern=InOut&amp;dataFormat=PAYLOAD" />

  <bean ref="customerOrderReply" method="getExc" />

</route>

I am doing a test and expecting method getExc being executed.

public void getExc(Exchange exc) throws Exception {
System.out.println("IN-MESSAGE: [" + exc.getInMessage() + "]");
}

However, it was looking for a method with the body=CustomerOrderMessage (the type I was sending to the remote server).

Do you have a clue of how to catch the actual reply the remote server was sending back to the Membrane Service Proxy?

With kind regards
Markus


On Monday, November 9, 2015 at 1:22:05 PM UTC+1, Tobias Polley wrote:
Reply all
Reply to author
Forward
0 new messages