Event Bus Spring Configuration with ActiveMQ & AMQP Terminal

Hi,

Can anyone please help on what needs to be done to configure an event bus with ActiveMQ and AMQP Terminal?

Thanks | Abhishek

Are you using xml or java configuration?

xml it is!

Hi,

here’s a configuration file used in the test cases:
https://github.com/AxonFramework/AxonFramework/blob/master/amqp/src/test/resources/META-INF/spring/amqp-namespace-context.xml

It shows the configuration of a terminal and custom amqp configuration for a cluster.
You’ll need to pass a reference to the cluster in your <axon:event-bus terminal=""/> element.

Cheers,

Allard

Hi Allard,

I am new to axon and trying to use the activeMQ for eventbus from test case I tried to use below config but giving error

please suggest me the right way to configure the amqp in event bus.

<bean id=“connectionFactory” class =“org.apache.qpid.amqp_1_0.jms.impl.ConnectionFactoryImpl”>

<constructor-arg value="${ACTIVEMQ_HOST}" />

<constructor-arg value="${ACTIVEMQ_PORT}" />

<constructor-arg value="${ACTIVEMQ_USER}" />

<constructor-arg value="${ACTIVEMQ_PASSWORD}" />

<amqp:terminal id=“terminal” exchange-name=“Exchange” durable=“true” transactional=“false”

connection-factory=“connectionFactory” message-converter=“messageConverter”

routing-key-resolver=“routingKeyResolver” serializer=“serializer”>

<amqp:default-configuration transaction-size=“20” transaction-manager=“transactionManager”/>

</amqp:terminal>

<amqp:configuration id=“fullConfig”

acknowledge=“manual” advice-chain=“mockAdviceChain” concurrency=“1” queue-name=“Queue”

executor=“executor” error-handler=“errorHandler” receive-timeout=“10”

recovery-interval=“1000” shutdown-timeout=“10” transaction-manager=“transactionManager”

exclusive=“true” transaction-size=“200” prefetch=“1000”/>

<axon:cluster id=“testCluster” default=“true”>

axon:meta-data

<entry key=“AMQP.Config”>

<amqp:configuration transaction-size=“20000”/>

</axon:meta-data>

</axon:cluster>

<axon:event-bus id=“eventBus” terminal=“terminal” />

Hi,

can you provide a bit more detail about the error? Stack trace for example?

A quick glance reveils you’re using an AMQP 1.0 connector. I have only tested against 0.9.x (1.0 is under a lot of debate) myself, so I don’t know how that works out.

Cheers,

Allard

Cannot convert value of type [org.apache.qpid.amqp_1_0.jms.impl.ConnectionFactoryImpl] to required type [org.springframework.amqp.rabbit.connection.ConnectionFactory] for property ‘connectionFactory’: no matching editors or conversion strategy found

this the error I getting.

Thanks,
Siva

Ah. That’s because the Spring Amqp connector expects a rabbit client. Note that thus client should be able to talk to other amqp servers as well.