Quantcast
Channel: Apache Timeline
Viewing all articles
Browse latest Browse all 5648

camelContext.hasEndpoint() returns null when endpoint (apparently) exists

$
0
0
Hello,

I'm working with Camel 2.12.3

I have three routebuilders that consist of consuming messages from a seda
queue and sending them to a destination endpoint, like this:

from("seda:syncronizedMyQueue")
.to("myDestinationEndpoint");

When a message must be sent to one of these queues, I use the
camelContext.hasEndpoint() method (to verify that we are going to send a
message to an endpoint that exists, because I create these routebuilders
dynamically). The problem is that when a message is sent to one of these
queues that haven´t been used for a while, a null is retrieved (the API says
that if the endpoint does not exist, null is returned). Nevertheless, using
the JConsole I can see that the endpoint associated to that queue do exist.

Example:
I have the queues MyQueue1 and MyQueue2 (different routebuilders)

RouteBuilder1:
from("seda:syncronizedMyQueue1")
.to("myDestinationEndpoint1");

RouteBuilder2:
from("seda:syncronizedMyQueue2")
.to("myDestinationEndpoint2");

If, after camel context is up and both routebuilders are available, I start
sending messages to MyQueue1, no problem arises.

If after a while without sending a message (days or weeks) to MyQueue2 I
start sending messages to it, the method camelContext.hasEndpoint() returns
null.

In both cases I can see the endpoints of both queues available using the
JConsole. Both queues are active and have, apparently, the same values in
each attribute.

I wanted to ask if there is any known issue (or expected behaviour) that can
cause that a seda queue endpoint that is not used for a while (days or even
weeks) stops being recognised by the camel context)

Thanks in advance.

QR.

Aida.

Viewing all articles
Browse latest Browse all 5648

Trending Articles