|
Re: ActiveMQ Integration [message #933916 is a reply to message #930481] |
Fri, 05 October 2012 13:06 |
|
Hi,
I integrated activemq in Virgo, you just have to make a little bundle containing the amq configuration, here's mine (it just embed a META-INF/spring/activemqconf.xml:
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:amq="http://activemq.apache.org/schema/core"
xmlns:osgi="http://www.springframework.org/schema/osgi"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:osgi-compendium="http://www.springframework.org/schema/osgi-compendium"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="
http://www.springframework.org/schema/osgi http://www.springframework.org/schema/osgi/spring-osgi.xsd
http://www.springframework.org/schema/osgi-compendium http://www.springframework.org/schema/osgi-compendium/spring-osgi-compendium.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd
http://activemq.apache.org/schema/core http://activemq.apache.org/schema/core/activemq-core.xsd">
<osgi-compendium:cm-properties id="jmsConfigProperties" persistent-id="jms-config"/>
<context:property-placeholder properties-ref="jmsConfigProperties"/>
<amq:broker brokerName="brokerB1" shutdownOnMasterFailure="true"
>
<amq:destinationPolicy>
<amq:policyMap>
<amq:policyEntries>
<amq:policyEntry queue=">" producerFlowControl="true"
memoryLimit="5mb">
<amq:deadLetterStrategy>
<amq:individualDeadLetterStrategy
queuePrefix="DLQ." useQueueForQueueMessages="true" />
</amq:deadLetterStrategy>
</amq:policyEntry>
</amq:policyEntries>
</amq:policyMap>
</amq:destinationPolicy>
<amq:managementContext>
<amq:managementContext createConnector="false" />
</amq:managementContext>
<amq:persistenceAdapter>
<amq:kahaDB directory="activeMQ/kahadb"
enableJournalDiskSyncs="false" indexWriteBatchSize="10000"
indexCacheSize="1000" />
</amq:persistenceAdapter>
<amq:plugins>
<amq:loggingBrokerPlugin />
</amq:plugins>
<amq:systemUsage>
<amq:systemUsage>
<amq:memoryUsage>
<amq:memoryUsage limit="420 mb" />
</amq:memoryUsage>
<amq:storeUsage>
<amq:storeUsage limit="1 gb" />
</amq:storeUsage>
<amq:tempUsage>
<amq:tempUsage limit="250 mb" />
</amq:tempUsage>
</amq:systemUsage>
</amq:systemUsage>
<amq:transportConnectors>
<amq:transportConnector name="tcp"
uri="${transportconnector.uri}" />
</amq:transportConnectors>
</amq:broker>
<!-- JMS ConnectionFactory to use, configuring the embedded broker using
XML -->
<amq:connectionFactory id="jmsFactory" brokerURL="${connectionfactory.uri}" />
<bean id="cachedConnectionFactory"
class="org.springframework.jms.connection.CachingConnectionFactory">
<property name="targetConnectionFactory" ref="jmsFactory" />
<property name="sessionCacheSize" value="3" />
</bean>
<osgi:service ref="cachedConnectionFactory"
interface="javax.jms.ConnectionFactory"/>
</beans>
With this, you can have a jms-config.properties in your usr repo:
transportconnector.uri=tcp://0.0.0.0:61616
connectionfactory.uri=vm://localhost
Then you should be able to reference the amq connectionfaction via service reference (blueprint, spring-dm...).
Charlie
[Updated on: Fri, 05 October 2012 13:09] Report message to a moderator
|
|
|
Re: ActiveMQ Integration [message #1000022 is a reply to message #933916] |
Sun, 13 January 2013 20:05 |
Miguel Salinas Gancedo Messages: 8 Registered: October 2012 |
Junior Member |
|
|
Hi Charlie,
I was trying to follow your example with Virgo 3.0.2. I create the bundle like you and add the necesary bundles to my virgo instance and create the properties file called jms-config.properties and save it in:
/opt/virgo-tomcat-server-3.0.3.RELEASE/repository/usr directory
And i obtaind the error:
... Could not resolve placeholder 'transportconnector.uri'
That you see i cant not recover the properties from the file throw spring. I also save the file in the /opt/virgo-tomcat-server-3.0.3.RELEASE/repository/usr/config directory and the error it's the same.
If I add default values to the properties configuration the system run ok, but if not I obtained the previous error:
<osgi-compendium:cm-properties id="jmsConfigProperties" persistent-id="jms-config">
<prop key="transportconnector.uri">tcp://0.0.0.0:61616</prop>
<prop key="connectionfactory.uri">vm://localhost</prop>
</osgi-compendium:cm-properties>
Where I must save the properties file inside Virgo?
Best regards.
[Updated on: Sun, 13 January 2013 20:27] Report message to a moderator
|
|
|
|
Powered by
FUDForum. Page generated in 0.02849 seconds