Hi to all,
i have a little (or big) problem. I have created the following architecture:
producer -> broker (servicemix WSN2005) -> consumer (web service)
i'm able to send and receive a notification from producer to receiver.
Now i should configure activemq to implement the persistence of message.
This is my activemq.xml:
<beans>
<!-- ActiveMQ JMS Broker configuration -->
−
<amq:broker id="broker" depends-on="jmxServer" persistent="true"
useShutdownHook="false">
−
<!--
Disable creation of the jmx connector
which is created in the jmx.xml configuration file
-->
−
<amq:managementContext>
−
<bean class="org.apache.activemq.broker.jmx.ManagementContext">
<property name="createConnector" value="false"/>
</bean>
</amq:managementContext>
−
<!--
Use AMQ Message Store as default broker persistence adapter
-->
−
<amq:persistenceAdapter>
<amq:journaledJDBC journalLogFiles="5" dataDirectory="../data"
dataSource="#mysql-ds"/>
</amq:persistenceAdapter>
<!-- Examples for journaledJDBC if JDBC is required -->
−
<!--
<amq:journaledJDBC journalLogFiles="5" dataDirectory="./data/amq"/>
-->
−
<amq:transportConnectors>
−
<!--
Activate a TCP connector with multicast discovery.
Note that multicast may be disabled if your computer
is not on a network, which may prevent the broker to start.
In such a case, just remove the discoveryUri attribute.
-->
<amq:transportConnector uri="tcp://localhost:61616"
discoveryUri="multicast://default"/>
</amq:transportConnectors>
−
<amq:networkConnectors>
<!-- by default just auto discover the other brokers -->
<amq:networkConnector uri="multicast://default"/>
−
<!--
<amq:networkConnector
uri="static://(tcp://host1:61616,tcp://host2:61616)"/>
-->
</amq:networkConnectors>
</amq:broker>
<!--
MySql DataSource Setup using the Commons DBCP pooler
(http://jakarta.apache.org/commons/dbcp/)
-->
−
<bean id="mysql-ds" class="org.apache.commons.dbcp.BasicDataSource"
destroy-method="close">
<property name="driverClassName" value="com.mysql.jdbc.Driver"/>
<property name="url" value="jdbc:mysql://10.20.102.78:3306/activemq"/>
<property name="username" value="activemqUser"/>
<property name="password" value="Password123"/>
<property name="poolPreparedStatements" value="true"/>
</bean>
</beans>
and this is my servicemix.xml
<beans xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
http://servicemix.apache.org/config/1.0
http://servicemix.apache.org/schema/servicemix-core.xsd
http://servicemix.apache.org/audit/1.0
http://servicemix.apache.org/schema/servicemix-audit.xsd">
<!-- System properties -->
−
<sm:systemProperties>
−
<property name="properties">
−
<map>
−
<entry key="java.security.auth.login.config">
−
<bean class="org.springframework.util.ResourceUtils"
factory-method="getFile">
<constructor-arg value="classpath:login.properties"/>
</bean>
</entry>
</map>
</property>
</sm:systemProperties>
−
<bean id="propertyConfigurer"
class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="location" value="classpath:servicemix.properties"/>
</bean>
<!-- Include other resources -->
<import resource="classpath:security.xml"/>
<import resource="classpath:jmx.xml"/>
<import resource="classpath:activemq.xml"/>
<import resource="classpath:tx.xml"/>
<import resource="classpath:jndi.xml"/>
<!-- the JBI container -->
−
<sm:container id="jbi" rootDir="./data/smx" persistent="true"
MBeanServer="#jmxServer" installationDirPath="./hotdeploy"
monitorDeploymentDirectory="false" monitorInterval="1"
transactionManager="#transactionManager" createJmxConnector="false">
<sm:activationSpecs/>
−
<!--
Use a secured broker (see security.xml)
and define the 3 standard flows
-->
−
<sm:broker>
−
<sm:securedBroker authorizationMap="#authorizationMap">
−
<sm:flows>
<sm:sedaFlow/>
<sm:jmsFlow jmsURL="${activemq.url}"/>
<sm:jcaFlow connectionManager="#connectionManager"
jmsURL="${activemq.url}"/>
</sm:flows>
</sm:securedBroker>
</sm:broker>
−
<sm:executorFactory>
−
<bean class="org.apache.servicemix.executors.impl.ExecutorFactoryImpl">
−
<property name="defaultConfig">
−
<bean class="org.apache.servicemix.executors.impl.ExecutorConfig">
<property name="corePoolSize" value="${servicemix.corePoolSize}"/>
<property name="maximumPoolSize" value="${servicemix.maximumPoolSize}"/>
<property name="queueSize" value="${servicemix.queueSize}"/>
</bean>
</property>
</bean>
</sm:executorFactory>
−
<sm:services>
<sm:statistics statsInterval="10" dumpStats="true"/>
</sm:services>
</sm:container>
−
<audit:jdbcAuditor container="#jbi" autoStart="false">
−
<audit:dataSource>
−
<bean class="org.apache.derby.jdbc.EmbeddedDataSource">
<property name="databaseName" value="servicemixDB"/>
<property name="createDatabase" value="create"/>
</bean>
</audit:dataSource>
</audit:jdbcAuditor>
<sm:dotViewService container="#jbi" autoStart="true"/>
<sm:logService container="#jbi" autoStart="true" refreshPeriod="60"/>
</beans>
I've introduced persistent="true" in either to obtain the persistence of
message in the database.
My problem is that i don't receive messages in the consumer but they are
only saved in the db.
Where i wrong?
SECOND QUESTION
If i set persistence=true in the the jbi part in the servicemix.xml, in my
db i can see all message delivered by JBI WSN2005: notification and
subscription (i suppose). What is the way to change wsn2005 component to set
persistence=true in the notification message?
THANKS
MG
--
View this message in context:
http://servicemix.396122.n5.nabble.com/Message-persistence-with-wsn2005-and-activemq-tp3367996p3367996.html
Sent from the ServiceMix - Dev mailing list archive at Nabble.com.