You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by taran <ta...@globallogic.com> on 2008/05/31 10:41:47 UTC
Routing message to camel endpoint results in polling
Hi,
I'm routing a message from bean endpoint to camel endpoint.
Then, in my camel route builder, i'm routing message from this camel
endpoint to log.
But, when a message is sent to bean endpoint, it starts polling.
my bean endpoint code is:
public void onMessageExchange(MessageExchange reverseExchange)
throws MessagingException {
System.out.println(" ### INSIDE MerlinBureauPreferenceBean ### ");
ServiceEndpoint serviceEndpoint = context.getEndpoint(new
QName("http://com.thirdpillar.scoring", "CamelService"),"CamelEndpoint");
InOnly forwardExchange =
channel.createExchangeFactory(serviceEndpoint).createInOnlyExchange();
MessageUtil.transferInToIn(reverseExchange, forwardExchange);
channel.send(forwardExchange);
}
and my camel route builder code is:
from("jbi:endpoint:http://com.thirdpillar.scoring/CamelService/CamelEndpoint")
.convertBodyTo(DOMSource.class)
.splitter(XPathBuilder.xpath("//typ:Party").namespace("typ",
"http://thirdpillar.com/scoring"))
.convertBodyTo(String.class)
.to("log:scoring-scoringrouter2")
.to(SEDA_CHOICE);
when i send a message to bean endpoint, i keep getting system.out.println
"### INSIDE MerlinBureauPreferenceBean ### " on the servicemix console.
Request for urgent help on this.
best regards
tarandeep
--
View this message in context: http://www.nabble.com/Routing-message-to-camel-endpoint-results-in-polling-tp17573215s22882p17573215.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: Routing message to camel endpoint results in polling
Posted by Roman Kalukiewicz <ro...@gmail.com>.
Tarandeep,
It looks that you don't check the status of MessageExchange you receive at all.
I remember some time ago (in version fuse-3.3.0.2) it was impossible
to send messages from bean endpoints because Bean endpoint couldn't
match the response with the request and it was throwing exceptions.
Anyway, even if it works now then responses (DONE messages in this
case) from camel return to your bean endpoint using onMessageExchange
method so you have a loop without an end condition ;) Whenever camel
finishes its work and sends DONE to bean endpoint you send another
request to camel.
Roman
2008/5/31 taran <ta...@globallogic.com>:
>
> Hi,
> I'm routing a message from bean endpoint to camel endpoint.
> Then, in my camel route builder, i'm routing message from this camel
> endpoint to log.
>
> But, when a message is sent to bean endpoint, it starts polling.
>
> my bean endpoint code is:
> public void onMessageExchange(MessageExchange reverseExchange)
> throws MessagingException {
> System.out.println(" ### INSIDE MerlinBureauPreferenceBean ### ");
> ServiceEndpoint serviceEndpoint = context.getEndpoint(new
> QName("http://com.thirdpillar.scoring", "CamelService"),"CamelEndpoint");
> InOnly forwardExchange =
> channel.createExchangeFactory(serviceEndpoint).createInOnlyExchange();
>
> MessageUtil.transferInToIn(reverseExchange, forwardExchange);
> channel.send(forwardExchange);
> }
>
> and my camel route builder code is:
> from("jbi:endpoint:http://com.thirdpillar.scoring/CamelService/CamelEndpoint")
> .convertBodyTo(DOMSource.class)
> .splitter(XPathBuilder.xpath("//typ:Party").namespace("typ",
> "http://thirdpillar.com/scoring"))
> .convertBodyTo(String.class)
> .to("log:scoring-scoringrouter2")
> .to(SEDA_CHOICE);
>
> when i send a message to bean endpoint, i keep getting system.out.println
> "### INSIDE MerlinBureauPreferenceBean ### " on the servicemix console.
>
> Request for urgent help on this.
>
> best regards
> tarandeep
> --
> View this message in context: http://www.nabble.com/Routing-message-to-camel-endpoint-results-in-polling-tp17573215s22882p17573215.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>
>
Re: Routing message to camel endpoint results in polling
Posted by taran <ta...@globallogic.com>.
Dear Roman
Many thanks for your inputs.
I could resolve the issue based on your inputs.
Your observation is correct, due to camel endpoint sending Done message to
bean endpoint, it was getting into infinite loop
thanks again
taran
taran wrote:
>
> Hi,
> I'm routing a message from bean endpoint to camel endpoint.
> Then, in my camel route builder, i'm routing message from this camel
> endpoint to log.
>
> But, when a message is sent to bean endpoint, it starts polling.
>
> my bean endpoint code is:
> public void onMessageExchange(MessageExchange reverseExchange)
> throws MessagingException {
> System.out.println(" ### INSIDE MerlinBureauPreferenceBean ### ");
> ServiceEndpoint serviceEndpoint = context.getEndpoint(new
> QName("http://com.thirdpillar.scoring", "CamelService"),"CamelEndpoint");
> InOnly forwardExchange =
> channel.createExchangeFactory(serviceEndpoint).createInOnlyExchange();
>
> MessageUtil.transferInToIn(reverseExchange, forwardExchange);
> channel.send(forwardExchange);
> }
>
> and my camel route builder code is:
> from("jbi:endpoint:http://com.thirdpillar.scoring/CamelService/CamelEndpoint")
> .convertBodyTo(DOMSource.class)
> .splitter(XPathBuilder.xpath("//typ:Party").namespace("typ",
> "http://thirdpillar.com/scoring"))
> .convertBodyTo(String.class)
> .to("log:scoring-scoringrouter2")
> .to(SEDA_CHOICE);
>
> when i send a message to bean endpoint, i keep getting system.out.println
> "### INSIDE MerlinBureauPreferenceBean ### " on the servicemix console.
>
> Request for urgent help on this.
>
> best regards
> tarandeep
>
--
View this message in context: http://www.nabble.com/Routing-message-to-camel-endpoint-results-in-polling-tp17573215s22882p17617588.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: Routing message to camel endpoint results in polling
Posted by James Strachan <ja...@gmail.com>.
BTW you're talking about servicemix bean endpoints right? Not Camel
bean endpoints?
2008/5/31 taran <ta...@globallogic.com>:
>
> Hi,
> I'm routing a message from bean endpoint to camel endpoint.
> Then, in my camel route builder, i'm routing message from this camel
> endpoint to log.
>
> But, when a message is sent to bean endpoint, it starts polling.
>
> my bean endpoint code is:
> public void onMessageExchange(MessageExchange reverseExchange)
> throws MessagingException {
> System.out.println(" ### INSIDE MerlinBureauPreferenceBean ### ");
> ServiceEndpoint serviceEndpoint = context.getEndpoint(new
> QName("http://com.thirdpillar.scoring", "CamelService"),"CamelEndpoint");
> InOnly forwardExchange =
> channel.createExchangeFactory(serviceEndpoint).createInOnlyExchange();
>
> MessageUtil.transferInToIn(reverseExchange, forwardExchange);
> channel.send(forwardExchange);
> }
>
> and my camel route builder code is:
> from("jbi:endpoint:http://com.thirdpillar.scoring/CamelService/CamelEndpoint")
> .convertBodyTo(DOMSource.class)
> .splitter(XPathBuilder.xpath("//typ:Party").namespace("typ",
> "http://thirdpillar.com/scoring"))
> .convertBodyTo(String.class)
> .to("log:scoring-scoringrouter2")
> .to(SEDA_CHOICE);
>
> when i send a message to bean endpoint, i keep getting system.out.println
> "### INSIDE MerlinBureauPreferenceBean ### " on the servicemix console.
>
> Request for urgent help on this.
>
> best regards
> tarandeep
> --
> View this message in context: http://www.nabble.com/Routing-message-to-camel-endpoint-results-in-polling-tp17573215s22882p17573215.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>
>
--
James
-------
http://macstrac.blogspot.com/
Open Source Integration
http://open.iona.com