Hi and thank you for your quick reply!
James.Strachan wrote:
>
> Just to be a pedant; its Spring's MessageListenerContainer which keeps
> adding/removing JMS consumers :)...
>
I am sorry for beeing unclear. I know its springs fault =).
James.Strachan wrote:
>
> I'm a bit confused how you are creating Camel and running the routes?
>
We are not using the xbean style to configure camel, so thats how we set up
the camel context:
<bean id="camel" class="org.apache.camel.spring.SpringCamelContext" />
<bean id="camelEndpointFactory" class="....CamelEndpointFactory" />
<bean class="org.apache.camel.spring.CamelBeanPostProcessor">
<property name="camelContext" ref="camel" />
</bean>
James.Strachan wrote:
>
> What is camelEndpointFactory ?
>
its basically a class we wrote doing just the following:
public Object getEndpoint( String uri ) throws Exception {
return camelContext.getEndpoint( uri );
}
We want to be as independent as possible from the underlying messaging
sollution.
James.Strachan wrote:
>
>> <!-- CAMEL ROUTES -->
>>
>> <bean id="routesType" class="Routes">
>> <property name="routes">
>> <list>
>> <bean class="...Route">
>> <property name="input" ref="queueTest" />
>> <property name="output">
>> <list>
>> <ref bean="testBean" />
>> </list>
>> </property>
>> </bean>
>> </list>
>> </property>
>> </bean>
>
> I'm not sure what this is meant to do?
>
> So its a bit hard to track down as I can't see how you are using
> Camel. Any reason why you are not defining a <camelContext> then
> either using <package> or <route> inside there?
>
We preferred to specify the route not using the xbean style. This is mainly
because we extended some of the camel components to suit our needs. The main
goal was to add our functionallity and to make it easier for us to specify
the routes that way.
This basic route just takes all messages from "queueTest" and invoke the
specifiy functions in the "testBean" according to the Type of the object
beeing send. This works nicely.
But if i create a route with camel listening to a jms queue it uses springs
messageListenerContainer. I feel the problem is that theese listeners are
not that great =).
If i do it without setting any additional properties in the JmsComponent a
DefaultMessageListenerContainer which is polling for messages, always
creating a new consumer every second. I feel that this is a bad behaivior so
i wanted to use the ServerSessionMessageListenerContainer. But i cannot get
the ServerSessionMessageListenerContainer to run (session issue i decribed
in the last post).
Do you think i am running into this trouble because i dont use xbean's to
configure camel and the camelcontext? Without xbean is was simpler to add
features we need to camel (without haveing to change the xbean too).
I am not quite sure how to set up the jmsComponent properly in a production
environment. But when i start a broker and some of my components (like 10)
then 10 consumers are created and removed per second (and the number of
components will increase in the future).
I felt the urge to write a MessageListener myself and adopt camel to use it,
but before i do this i wanted to be sure that it is necessary.
So to sum things up. I am using JMS and activeMQ as a jmsProvider. I want to
send messages via queue's and i use camel to route the message (or better
call the right function in a bean specified by the message Type). All this
works, but i need some help setting up the messageListener in the right way.
I will create a simple example in the xbean style using only camel
components and post my findings.
kind regards
oliver
--
View this message in context:
http://www.nabble.com/Camel-keeps-adding-and-removing-Consumers-when-using-DefaultMessageListenerContainer-tf4778316s22882.html#a13703855
Sent from the Camel - Users mailing list archive at Nabble.com.