activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Arnau <arnaul...@andromeiberica.com>
Subject Re: Newbie question about simple application
Date Fri, 20 Jun 2008 13:45:32 GMT
Hi Joe,

ttmdev wrote:
> You may want to look into setting up a Camel context to implement such
> routing rules. 
> 
> http://activemq.apache.org/enterprise-integration-patterns.html
> 


   I think I have done. I paste my activemq.xml file:

<beans
   xmlns="http://www.springframework.org/schema/beans"
   xmlns:amq="http://activemq.apache.org/schema/core"
   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
   xsi:schemaLocation="http://www.springframework.org/schema/beans 
http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
   http://activemq.apache.org/schema/core 
http://activemq.apache.org/schema/core/activemq-core.xsd
   http://activemq.apache.org/camel/schema/spring 
http://activemq.apache.org/camel/schema/spring/camel-spring.xsd">

     <!-- Allows us to use system properties as variables in this 
configuration file -->
     <bean 
class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"/>

     <broker xmlns="http://activemq.apache.org/schema/core" 
brokerName="fawkes" dataDirectory="${activemq.base}/data" 
deleteAllMessagesOnStartup="true">

         <!-- The transport connectors ActiveMQ will listen to -->
         <transportConnectors>
             <transportConnector name="openwire" 
uri="tcp://192.168.10.65:61616"/>
         </transportConnectors>

         <!-- Destination specific policies using destination names or 
wildcards -->
         <destinationPolicy>
             <policyMap>
                 <policyEntries>
                     <policyEntry queue=">" memoryLimit="5mb"/>
                     <policyEntry topic=">" memoryLimit="5mb">
                         <dispatchPolicy>
                             <strictOrderDispatchPolicy/>
                         </dispatchPolicy>
                         <subscriptionRecoveryPolicy>
                             <lastImageSubscriptionRecoveryPolicy/>
                         </subscriptionRecoveryPolicy>
                     </policyEntry>
                 </policyEntries>
             </policyMap>
         </destinationPolicy>

         <!-- Use the following to configure how ActiveMQ is exposed in 
JMX -->
         <managementContext>
             <managementContext createConnector="false"/>
         </managementContext>

         <!-- The store and forward broker networks ActiveMQ will listen 
to -->
         <networkConnectors>
             <networkConnector
             name="fawkes"
             uri="static://(tcp://192.168.10.75:61616)"
             dispatchAsync="true"/>
         </networkConnectors>

         <persistenceAdapter>
             <amqPersistenceAdapter syncOnWrite="false" 
directory="${activemq.base}/data" maxFileLength="20 mb"/>
         </persistenceAdapter>

         <destinations>
           <queue physicalName="ANDROME.TX" />
           <topic physicalName="ANDROME Transmission queue" />
         </destinations>

         <destinations>
           <queue physicalName="ANDROME.RX" />
           <topic physicalName="ANDROME Reception queue" />
         </destinations>

         <systemUsage>
             <systemUsage>
                 <memoryUsage>
                     <memoryUsage limit="20 mb"/>
                 </memoryUsage>
                 <storeUsage>
                     <storeUsage limit="1 gb" name="foo"/>
                 </storeUsage>
                 <tempUsage>
                     <tempUsage limit="100 mb"/>
                 </tempUsage>
             </systemUsage>
         </systemUsage>
     </broker>

     <camelContext id="camel" 
xmlns="http://activemq.apache.org/camel/schema/spring">

         <!-- You can use a <package> element for each root package to 
search for Java routes -->
         <package>org.foo.bar</package>

         <!-- You can use Spring XML syntax to define the routes here 
using the <route> element -->
         <route>
             <from uri="activemq:ANDROME.TX"/>
             <to uri="activemq:SINERMEDIA.RX"/>
         </route>

     </camelContext>

     <!-- An embedded servlet engine for serving up the Admin console -->
     <jetty xmlns="http://mortbay.com/schemas/jetty/1.0">
         <connectors>
             <nioConnector port="8161"/>
         </connectors>

         <handlers>
             <webAppContext contextPath="/admin" 
resourceBase="${activemq.base}/webapps/admin" logUrlOnStart="true"/>
             <webAppContext contextPath="/demo" 
resourceBase="${activemq.base}/webapps/demo" logUrlOnStart="true"/>
             <webAppContext contextPath="/fileserver" 
resourceBase="${activemq.base}/webapps/fileserver" logUrlOnStart="true"/>
         </handlers>
     </jetty>

</beans>
<!-- END SNIPPET: example -->






> 
> 
> 
> Arnau wrote:
>> Hi all,
>>
>>   Yesterday I discovered ActiveMQ and I have been banging my head
>> against a wall :).
>>
>>   What I'd like to do is the following:
>>
>>   1. Create a local broker (A) that comunicates with a remote broker(B).
>> I'd use two diferent computers.
>>   2. Define two queues on each broker TX and RX
>>   3. All the messages put into A.TX should go to B.RX and vice versa
>> B.TX->A.RX
>>   4. I'd like to configure the activemq.xml to allow this setup and test
>> it with the webinterface. I'd like to sent a message on TX queue on the
>> webinterface and receive it on RX queue on the other computer
>>
>>   Can anybody help me? I have been searching in the web and also
>> downloaded the user guide from ttmsolutions.com and I haven't been able
>> to make it work.
>>
>> Thank you very much!!
>>
>>
> 


Mime
View raw message