Hi,
I was wondering what happens when i configure two brokers and use the
request reply pattern for both of them
Here Is Broker 1
<bean id = "activemq"
class="org.apache.activemq.camel.component.ActiveMQComponent">
<property name="brokerURL" value="vm://boClientBroker"/>
</bean>
<bean id = "financialProcessor" class =
"com.ccti.citrine.service.financials.FinancialProcessorImpl">
<property name = "producerTemplate" ref = "producerTemplate"/>
</bean>
<amq:broker brokerName="vm://boClientBroker" useShutdownHook="true"
persistent = "false">
<amq:networkConnectors>
<amq:networkConnector uri="static:(tcp://localhost:8007)"
duplex="true">
<amq:staticallyIncludedDestinations>
<!-- It is connected to a queue named financials -->
<amq:queue name = "financials" physicalName="financials"
></amq:queue>
</amq:staticallyIncludedDestinations>
</amq:networkConnector>
</amq:networkConnectors>
<amq:transportConnectors>
<amq:transportConnector uri = "vm://boClientBroker" />
</amq:transportConnectors>
</amq:broker>
<camel:camelContext id = "citrineContext">
<camel:template id = "producerTemplate" ></camel:template>
</camel:camelContext>
Here Is Broker Two
<bean id = "activemq"
class="org.apache.activemq.camel.component.ActiveMQComponent">
<property name="brokerURL" value="vm://foClientBroker"/>
</bean>
<bean id = "financialProcessor" class =
"com.ccti.citrine.service.financials.FinancialProcessorImpl">
<property name = "producerTemplate" ref = "producerTemplate"/>
</bean>
<amq:broker brokerName="foClientBroker" useShutdownHook="true"
persistent = "false">
<amq:networkConnectors>
<amq:networkConnector uri="static:(tcp://localhost:8007)"
duplex="true">
<amq:staticallyIncludedDestinations>
<!-- Also Links To A Queue Named Financials -->
<amq:queue name = "financials" physicalName="financials"
></amq:queue>
</amq:staticallyIncludedDestinations>
</amq:networkConnector>
</amq:networkConnectors>
<amq:transportConnectors>
<amq:transportConnector uri = "vm://foClientBroker" />
</amq:transportConnectors>
</amq:broker>
<camel:camelContext id = "citrineContext">
<camel:template id = "producerTemplate" ></camel:template>
</camel:camelContext>
Here is the broker they connect to:
<!-- Broker Implementation To Be Used -->
<amq:broker id = "jposBroker" brokerName = "jposBroker" persistent =
"false">
<amq:transportConnectors>
<amq:transportConnector uri = "tcp://localhost:8007/">
</amq:transportConnector>
</amq:transportConnectors>
</amq:broker>
<!-- ActiveMQ Component To Be Used For Camel -->
<bean id = "activemq"
class="org.apache.activemq.camel.component.ActiveMQComponent">
<property name="brokerURL" value="tcp://localhost:8007/"/>
</bean>
i was wondering if i will have any issues regarding this.
i am using camel''s producer template to request a message and a response.
Is it possible for me to get overlap errors? like broker 1 getting results
for broker 2
public FinancialObject sendFinancialRequest(FinancialObject financialObject)
{
FinancialObject resultObject = (FinancialObject)
producerTemplate.requestBody("activemq:financials?requestTimeout=30000000",
financialObject);
}