camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From EJLeVin1 <ejlev...@hotmail.com>
Subject New connection being created for every message (post 1.3 camel)
Date Fri, 06 Jun 2008 05:22:33 GMT

I seem to be having an issue with a new connection being created for every
message that is getting sent over my activemq endpoint.  I looked this up,
and remember how polling used to make alot of connections; however, remember
that getting changed in version 1.3.  I tried playing with my configurations
settings (setting them all to the default, then changing the to optimize
sending, changing the cacheLevelName, etc) and nothing seemed to change my
results.

So here is what I am seeing... When I run this tester app (I quickly created
this to try and prove that I was configuring my primary project incorrectly
:) ) against a standalone instance of activemq 5.1 (the tester app will
connect through localhost:61616), I subsequently look at the AMQ through
JConsole and see the connections going crazy as messages are getting
sent/received from the tester app.

I've attached the tester if anyone wants to see it first hand (simply run
'mvn test' after starting activemq on your machine)
http://www.nabble.com/file/p17684874/ActiveMQ-Camel-Test.zip
ActiveMQ-Camel-Test.zip  -- otherwise, here is my configuration:

POM DEPENDENCIES:

<dependency>
    	<groupId>org.apache.camel</groupId>
    	<artifactId>camel-core</artifactId>
	  	<version>1.3.0</version>
	</dependency>
	<dependency>
    	<groupId>org.apache.camel</groupId>
    	<artifactId>camel-spring</artifactId>
	  	<version>1.3.0</version>
	</dependency>
	<dependency>
    	<groupId>org.apache.camel</groupId>
    	<artifactId>camel-jms</artifactId>
	  	<version>1.3.0</version>
	</dependency>

<dependency>
      <groupId>org.apache.activemq</groupId>
      <artifactId>activemq-core</artifactId>
      <version>5.1.0</version>
    </dependency>

    <dependency>
      <groupId>org.springframework</groupId>
      <artifactId>spring</artifactId>
      <version>2.5.1</version>
    </dependency>

SPRING CONTEXT ---

<!-- Define the camel context -->
	<camelContext id="camel" useJmx="true"
		xmlns="http://activemq.apache.org/camel/schema/spring">
		<package>com.mycompany</package>
		<route>
			<from uri="direct:output" />
			<to uri="activemq:topic:received-messages" />
		</route>
	</camelContext>

	<!-- The activemq default configuration -->
	<bean id="activemq"
		class="org.apache.camel.component.jms.JmsComponent">
		<property name="connectionFactory">
			<bean
				class="org.apache.activemq.ActiveMQConnectionFactory">
				<property name="brokerURL"
					value="tcp://localhost:61616" />
			</bean>
		</property>
	</bean>

	<!-- The bean that will invoke the producer.. -->
	<bean id="someProducerBean" class="com.mycompany.SomeProducer" />

When I invoke the producer that is getting injected into
com.mycompany.SomeProducer, the message gets send to the direct:output,
which then gets sent to activemq through camel's defined routes.  Anyone
have any ideas on why this would be creating/destroying a new connection for
every message?

Thanks for the help!
-- 
View this message in context: http://www.nabble.com/New-connection-being-created-for-every-message-%28post-1.3-camel%29-tp17684874s22882p17684874.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Mime
View raw message