You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by anoordover <an...@live.nl> on 2013/05/10 17:25:31 UTC

large war or several smaller wars

What should we do if we use camel and activemq?
1. Should we create much small wars (this is what we currently do)
2. One large war
3. Several wars which group functionality according to the type of
functionality (e.g. create one war for all functions that create file,
create one war for all functions that read files, ... or any other grouping
mechanism)

We currently seem to have an issue with getting a lot of connections to our
activemq server.
Sometimes the number of close_wait connections increase dramatically.

In our choice we need to create a pooledConnectionFactory in each war.



--
View this message in context: http://camel.465427.n5.nabble.com/large-war-or-several-smaller-wars-tp5732294.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: large war or several smaller wars

Posted by Christian Posta <ch...@gmail.com>.
Sorry, sent before pasting the link...

https://community.jboss.org/wiki/IntegratingActiveMQWithJBoss


On Mon, May 13, 2013 at 12:47 PM, Christian Posta <christian.posta@gmail.com
> wrote:

> can you try with the activemq resource adapter? I found this, might be
> useful:
>
>
>
> On Mon, May 13, 2013 at 11:34 AM, Preben.Asmussen <pr...@dr.dk> wrote:
>
>> have you tried activemq resource  adapters
>> <http://activemq.apache.org/resource-adapter.html>
>> It should work with jboss
>> If you run into any trouble with this try the activemq  forum
>> <http://activemq.2283324.n4.nabble.com/ActiveMQ-User-f2341805.html>
>> they
>> should be able to help with activemq setup.
>>
>>
>>
>> --
>> View this message in context:
>> http://camel.465427.n5.nabble.com/large-war-or-several-smaller-wars-tp5732294p5732435.html
>> Sent from the Camel - Users mailing list archive at Nabble.com.
>>
>
>
>
> --
> *Christian Posta*
> http://www.christianposta.com/blog
> twitter: @christianposta
>



-- 
*Christian Posta*
http://www.christianposta.com/blog
twitter: @christianposta

Re: large war or several smaller wars

Posted by Christian Posta <ch...@gmail.com>.
can you try with the activemq resource adapter? I found this, might be
useful:



On Mon, May 13, 2013 at 11:34 AM, Preben.Asmussen <pr...@dr.dk> wrote:

> have you tried activemq resource  adapters
> <http://activemq.apache.org/resource-adapter.html>
> It should work with jboss
> If you run into any trouble with this try the activemq  forum
> <http://activemq.2283324.n4.nabble.com/ActiveMQ-User-f2341805.html>   they
> should be able to help with activemq setup.
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/large-war-or-several-smaller-wars-tp5732294p5732435.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>



-- 
*Christian Posta*
http://www.christianposta.com/blog
twitter: @christianposta

Re: large war or several smaller wars

Posted by "Preben.Asmussen" <pr...@dr.dk>.
have you tried activemq resource  adapters
<http://activemq.apache.org/resource-adapter.html>  
It should work with jboss
If you run into any trouble with this try the activemq  forum
<http://activemq.2283324.n4.nabble.com/ActiveMQ-User-f2341805.html>   they
should be able to help with activemq setup.



--
View this message in context: http://camel.465427.n5.nabble.com/large-war-or-several-smaller-wars-tp5732294p5732435.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: large war or several smaller wars

Posted by anoordover <an...@live.nl>.
My JNDI solution doesn't seem to work.
It seems as though I get a serialized object from JNDI.
As I start producing messages new connections are created. Instead of
reusing the pooledConnections.
What i did is:
1. created a separate project that registers a
org.apache.activemq.pool.AmqJNDIPooledConnectionFactory in JNDI using the
JNDIExporter from the internet;
2. in the other projects I retreive this object from JNDI.

I think that I get a serialized object because when I undeploy the project
that registers the pool gets another object from the pool when it unbinds
the bound object (hashcode of the retrieved object is different).
Isn't this the correct way to share objects?
Should I use managed beans?



--
View this message in context: http://camel.465427.n5.nabble.com/large-war-or-several-smaller-wars-tp5732294p5732433.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: large war or several smaller wars

Posted by anoordover <an...@live.nl>.
I think i found a solution (still implementing it).
1. Create a war that uses spring to create a amqjndipooledtransactionfactory
2. Inside this use a jndiexporter that can be found on the internet to
export this bean to jndi
3. Inside jboss-web.xml in other wars define a depedency to the war of step
1
My feeling says that there should be other solutions, which are more
standardized.
But for now this will do.



--
View this message in context: http://camel.465427.n5.nabble.com/large-war-or-several-smaller-wars-tp5732294p5732338.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: large war or several smaller wars

Posted by anoordover <an...@live.nl>.
Sorry. I didn't realize that the environment would make such a difference.
We have jboss 5 as and activemq standalone running.
Until now i couldn't find an easy way to register a pooledconnection in jndi
inside jboss as i suppose i need to do.



--
View this message in context: http://camel.465427.n5.nabble.com/large-war-or-several-smaller-wars-tp5732294p5732304.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: large war or several smaller wars

Posted by "Preben.Asmussen" <pr...@dr.dk>.
I guess it depends on your runtime environment and appserver.
Here are some articles for tomcat 
http://pragmaticintegrator.wordpress.com/2011/01/17/combining-activemq-tomcat-and-mule-esb/
http://www.tomcatexpert.com/blog/2010/12/16/integrating-activemq-tomcat-using-local-jndi



--
View this message in context: http://camel.465427.n5.nabble.com/large-war-or-several-smaller-wars-tp5732294p5732303.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: large war or several smaller wars

Posted by anoordover <an...@live.nl>.
I was already looking into using JNDI for registering an
AmqJNDIPooledConnectionFactory but I couldn't find out how to register this
using an existing ActiveMQConnectionFactory (spring bean).
Does anybody have an example?

Preben.Asmussen wrote
> Seems like it would be nice to have a connection pool at jvm or appserver
> leve so that you can reuse connections between wars, and have a
> centralized pool. I'm not sure if this is doable with activemq.





--
View this message in context: http://camel.465427.n5.nabble.com/large-war-or-several-smaller-wars-tp5732294p5732302.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: large war or several smaller wars

Posted by "Preben.Asmussen" <pr...@dr.dk>.
Seems like it would be nice to have a connection pool at jvm or appserver
leve so that you can reuse connections between wars, and have a centralized
pool. I'm not sure if this is doable with activemq. 



--
View this message in context: http://camel.465427.n5.nabble.com/large-war-or-several-smaller-wars-tp5732294p5732301.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: large war or several smaller wars

Posted by anoordover <an...@live.nl>.
Currently we create beans for interacting with activemq in each project.
So a lot of poolConnectionFactories get created.
This creates a lot of connections to activemq and we also must invest a lot
to change this configuration.
The pro to this aproach is that change can be implemented standalone without
affecting other services.
Is the con bigger?
Should we centralize the beans in a separate war which includes jar for
other funtions (if we want to keep our projects small)?
This way less beans will be created (only one for a group of projects).

It isn't a Camel issue but I'm looking for advice how to split my wars or
how not to split my wars when I use camel and activemq.


Bruno Borges wrote
> Not sure if this is really a Camel issue, is it?
> 
> Could you please clarify the problem?





--
View this message in context: http://camel.465427.n5.nabble.com/large-war-or-several-smaller-wars-tp5732294p5732299.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: large war or several smaller wars

Posted by Bruno Borges <br...@gmail.com>.
Not sure if this is really a Camel issue, is it?

Could you please clarify the problem?

*Bruno Borges*
(11) 99564-9058
*www.brunoborges.com*


On Fri, May 10, 2013 at 12:25 PM, anoordover <an...@live.nl> wrote:

> What should we do if we use camel and activemq?
> 1. Should we create much small wars (this is what we currently do)
> 2. One large war
> 3. Several wars which group functionality according to the type of
> functionality (e.g. create one war for all functions that create file,
> create one war for all functions that read files, ... or any other grouping
> mechanism)
>
> We currently seem to have an issue with getting a lot of connections to our
> activemq server.
> Sometimes the number of close_wait connections increase dramatically.
>
> In our choice we need to create a pooledConnectionFactory in each war.
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/large-war-or-several-smaller-wars-tp5732294.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>