You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by NightWolf <ni...@gmail.com> on 2011/07/20 19:16:09 UTC

Camel issue with JMX Endpoints disappearing and endpoint injection for SEDA

Hi all,

There seems to be an issue with camel and JMX. One of the great features of
the SEDA JMX component is the ability to see the queue size using the get
queue method which is found under
org.apache.camel->endpoints->COMPNAME/camel->"seda://xyz"...

However when using something like 

/    @EndpointInject(uri="seda:closeData?concurrentConsumers=50")
    ProducerTemplate producerSymbQueue;
    //...
    producer.sendBody(object)
    //.../


In a POJO it would appear that the SEDA endpoint in JMX disappears and one
can no longer see the queue size...

Any ideas on what would be causing this and how to fix?

Cheers,
N

--
View this message in context: http://camel.465427.n5.nabble.com/Camel-issue-with-JMX-Endpoints-disappearing-and-endpoint-injection-for-SEDA-tp4616624p4616624.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Camel issue with JMX Endpoints disappearing and endpoint injection for SEDA

Posted by Claus Ibsen <cl...@gmail.com>.
On Thu, Jul 21, 2011 at 8:01 AM, NightWolf <ni...@gmail.com> wrote:
> With the annotations
>
> In beans:
> @EndpointInject(uri="seda:parsedStockPriceStream")
>
> @Produce(uri="seda:closeData")
>
> In Route Builder:
> from("seda:parsedStockPriceStream?concurrentConsumers=90")
>
>
> If Im using a SEDA queue and setting the number of concurrent consumers in
> the route build do I need to give the options in the inject annotation???
>

No only on the endpoint for the consumer. But you can use the 100%
identical uri for both the producer and consumer.
Only the consumer will use the concurrentConsumers option.

Only the queue name and queue size should be identical (well the queue
name actually)
The queue size will cause Camel to create the queue using the size for
the 1st endpoint being created.





> I'm assuming no..?
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Camel-issue-with-JMX-Endpoints-disappearing-and-endpoint-injection-for-SEDA-tp4616624p4618247.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>



-- 
Claus Ibsen
-----------------
FuseSource
Email: cibsen@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus, fusenews
Blog: http://davsclaus.blogspot.com/
Author of Camel in Action: http://www.manning.com/ibsen/

Re: Camel issue with JMX Endpoints disappearing and endpoint injection for SEDA

Posted by NightWolf <ni...@gmail.com>.
With the annotations 	

In beans:
@EndpointInject(uri="seda:parsedStockPriceStream")

@Produce(uri="seda:closeData")

In Route Builder:
from("seda:parsedStockPriceStream?concurrentConsumers=90")


If Im using a SEDA queue and setting the number of concurrent consumers in
the route build do I need to give the options in the inject annotation???

I'm assuming no..?



--
View this message in context: http://camel.465427.n5.nabble.com/Camel-issue-with-JMX-Endpoints-disappearing-and-endpoint-injection-for-SEDA-tp4616624p4618247.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Camel issue with JMX Endpoints disappearing and endpoint injection for SEDA

Posted by Claus Ibsen <cl...@gmail.com>.
Hi

I have reproduced the issue and created a ticket to track this
https://issues.apache.org/jira/browse/CAMEL-4263

Thanks for reporting.

I got a pending fix, just needed to be tested a bit more throughly.



On Sun, Jul 24, 2011 at 5:30 AM, NightWolf <ni...@gmail.com> wrote:
> Hi Claus,
>
> Tried with VM and same issue with SEDA. Copied the full URI from the route
> builder and used it as an injection point and it did not show up in JMX
> under endpoints.
>
> e.g. "vm:equityIndexUrls?concurrentConsumers=5"
>
> FYI - In camel context I have
>
> <jmxAgent id="agent" createConnector="true" registryPort="22888"
> registerAlways="true" />
>
> Sadly I dont have ActiveMQ so I cant test with another queue type. Could be
> a bug with the JMX registration..?
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Camel-issue-with-JMX-Endpoints-disappearing-and-endpoint-injection-for-SEDA-tp4616624p4627308.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>



-- 
Claus Ibsen
-----------------
FuseSource
Email: cibsen@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus, fusenews
Blog: http://davsclaus.blogspot.com/
Author of Camel in Action: http://www.manning.com/ibsen/

Re: Camel issue with JMX Endpoints disappearing and endpoint injection for SEDA

Posted by NightWolf <ni...@gmail.com>.
Hi Claus,

Tried with VM and same issue with SEDA. Copied the full URI from the route
builder and used it as an injection point and it did not show up in JMX
under endpoints. 

e.g. "vm:equityIndexUrls?concurrentConsumers=5"

FYI - In camel context I have 

<jmxAgent id="agent" createConnector="true" registryPort="22888" 
registerAlways="true" />

Sadly I dont have ActiveMQ so I cant test with another queue type. Could be
a bug with the JMX registration..?



--
View this message in context: http://camel.465427.n5.nabble.com/Camel-issue-with-JMX-Endpoints-disappearing-and-endpoint-injection-for-SEDA-tp4616624p4627308.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Camel issue with JMX Endpoints disappearing and endpoint injection for SEDA

Posted by Claus Ibsen <cl...@gmail.com>.
On Thu, Jul 21, 2011 at 12:38 PM, NightWolf <ni...@gmail.com> wrote:
> Tried with the register always = true in my context.xml and no change if I
> give the full URI. Only shows up in JMX if I enject only the seda:name with
> no options...
>

You have maybe hit an issue there since you use the annotations and
thus the endpoint may not be register in JMX as you would think. Can
you try with other kind of endpoints than just SEDA, just to see if
for some odd reason that works?




> --
> View this message in context: http://camel.465427.n5.nabble.com/Camel-issue-with-JMX-Endpoints-disappearing-and-endpoint-injection-for-SEDA-tp4616624p4618907.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>



-- 
Claus Ibsen
-----------------
FuseSource
Email: cibsen@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus, fusenews
Blog: http://davsclaus.blogspot.com/
Author of Camel in Action: http://www.manning.com/ibsen/

Re: Camel issue with JMX Endpoints disappearing and endpoint injection for SEDA

Posted by NightWolf <ni...@gmail.com>.
Tried with the register always = true in my context.xml and no change if I
give the full URI. Only shows up in JMX if I enject only the seda:name with
no options... 

--
View this message in context: http://camel.465427.n5.nabble.com/Camel-issue-with-JMX-Endpoints-disappearing-and-endpoint-injection-for-SEDA-tp4616624p4618907.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Camel issue with JMX Endpoints disappearing and endpoint injection for SEDA

Posted by NightWolf <ni...@gmail.com>.
Thanks Claus for your prompt help as always!

Im using Camel version 2.7.2. 

I just found that if using the exact same URI as I have in my Route builder
(see first post) I dont see it in JMX, if I just use the name in the inject
(as per the second post) it appears in JMX...

My RouteBuilder has the following routes:

		from("direct:financeData")
		.to("bean:parseYahooFinancePrice")
		.to("seda:parsedStockPriceStream?concurrentConsumers=90")

		from("seda:symbolsToProcess?concurrentConsumers=5")
		.to("bean:yahooHistoricalStream")
		.end();
		
		from("seda:closeData?concurrentConsumers=50")
		.to("jpa:com.sentimeasure.issa.stocks.dto.StockCloseDTO")
		.end();

		from("seda:parsedStockPriceStream?concurrentConsumers=90")
		.routeId("save-Stock-Data-to-DB")
		.to("jpa:com.sentimeasure.issa.stocks.dto.StockPriceDTO")
		//.to("log:JPA-OUT")
		.end();

I am using beans to send messages to some Seda endpoints. 

e.g. 
	@Produce(uri="seda:closeData?concurrentConsumers=50")
	private ProducerTemplate producer;
              //.............
                   producer.sendBody(data);

The route will not show up in JMX as an endpoint.

If I do :
	@Produce(uri="seda:closeData")
	private ProducerTemplate producer;

              producer.sendBody(data);

The route will appear in JMX. I initially assumed that the URI's needed to
be 100% identical... Guess I can just use the name. 

I will test out the register always = true in my context.xml.


--
View this message in context: http://camel.465427.n5.nabble.com/Camel-issue-with-JMX-Endpoints-disappearing-and-endpoint-injection-for-SEDA-tp4616624p4618310.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Camel issue with JMX Endpoints disappearing and endpoint injection for SEDA

Posted by Claus Ibsen <cl...@gmail.com>.
On Wed, Jul 20, 2011 at 7:16 PM, NightWolf <ni...@gmail.com> wrote:
> Hi all,
>
> There seems to be an issue with camel and JMX. One of the great features of
> the SEDA JMX component is the ability to see the queue size using the get
> queue method which is found under
> org.apache.camel->endpoints->COMPNAME/camel->"seda://xyz"...
>
> However when using something like
>
> /    @EndpointInject(uri="seda:closeData?concurrentConsumers=50")
>    ProducerTemplate producerSymbQueue;
>    //...
>    producer.sendBody(object)
>    //.../
>
>
> In a POJO it would appear that the SEDA endpoint in JMX disappears and one
> can no longer see the queue size...
>

Do you have any regular routes with the seda endpoint?
If not then thats the reason why its not in the JMX registry as Camel
by default only enlists the "stuff" from the routes.

There is an option to tell Camel to always register
http://camel.apache.org/camel-jmx.html
section Configuring whether to register mbeans always, for new routes
or just by default

By the way what version of Camel are you using?


> Any ideas on what would be causing this and how to fix?
>
> Cheers,
> N
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Camel-issue-with-JMX-Endpoints-disappearing-and-endpoint-injection-for-SEDA-tp4616624p4616624.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>



-- 
Claus Ibsen
-----------------
FuseSource
Email: cibsen@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus, fusenews
Blog: http://davsclaus.blogspot.com/
Author of Camel in Action: http://www.manning.com/ibsen/