large war or several smaller wars

classic Classic list List threaded Threaded
12 messages Options
Reply | Threaded
Open this post in threaded view
|

large war or several smaller wars

anoordover
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.
Reply | Threaded
Open this post in threaded view
|

Re: large war or several smaller wars

Bruno Borges
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 <[hidden email]> 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.
>
Reply | Threaded
Open this post in threaded view
|

Re: large war or several smaller wars

anoordover
This post was updated on .
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)?
Should we accept that we need to create bigger projects?

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?
Reply | Threaded
Open this post in threaded view
|

Re: large war or several smaller wars

Preben.Asmussen
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.
Reply | Threaded
Open this post in threaded view
|

Re: large war or several smaller wars

anoordover
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.
Reply | Threaded
Open this post in threaded view
|

Re: large war or several smaller wars

Preben.Asmussen
Reply | Threaded
Open this post in threaded view
|

Re: large war or several smaller wars

anoordover
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.
Reply | Threaded
Open this post in threaded view
|

Re: large war or several smaller wars

anoordover
In reply to this post by Preben.Asmussen
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.
Reply | Threaded
Open this post in threaded view
|

Re: large war or several smaller wars

anoordover
In reply to this post by Preben.Asmussen
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?
Reply | Threaded
Open this post in threaded view
|

Re: large war or several smaller wars

Preben.Asmussen
have you tried activemq resource adapters
It should work with jboss
If you run into any trouble with this try the activemq forum they should be able to help with activemq setup.
Reply | Threaded
Open this post in threaded view
|

Re: large war or several smaller wars

ceposta
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 <[hidden email]> 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
Reply | Threaded
Open this post in threaded view
|

Re: large war or several smaller wars

ceposta
Sorry, sent before pasting the link...

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


On Mon, May 13, 2013 at 12:47 PM, Christian Posta <[hidden email]
> 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 <[hidden email]> 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