开发者

Configuring ActiveMQ embedded in WAS cluster

Maybe it is not the usual way to do things but we are trying to deploy an application (EAR) inside a WAS 6.1 cluster with 2 nodes.

Each node will have his own broker and we would like to have them connected as a network via discovery.

The clients will connect to one of them via discovery also, and we have only one queue and one topic, and indeed is only the topic which needs to be in a broker network becouse the producer is inside the nodes and the consumer will be one of the client that can be connected to either node.

This has lead us to several problems, as we have to deploy only one EAR with one activemq.xml config file in it.

<beans:beans xmlns:beans="http://www.springframework.org/schema/beans"
  xmlns="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/sp开发者_StackOverflow社区ring-beans-2.5.xsd 
  http://activemq.apache.org/schema/core 
  http://activemq.apache.org/schema/core/activemq-core-5.4.1.xsd
  http://camel.apache.org/schema/spring
  http://camel.apache.org/schema/spring/camel-spring-2.5.0.xsd">
    <!-- Allows us to use system properties as variables in this configuration file
    <bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
         <property name="locations">
            <value>file:///./conf/credentials.properties</value>
         </property>
    </bean>
-->
<!-- <broker xmlns="http://activemq.apache.org/schema/core" brokerName="{hostname}" dataDirectory="./activemq-data"> -->
    <broker xmlns="http://activemq.apache.org/schema/core" brokerName="${COMPUTERNAME}" dataDirectory="./activemq-data">
        <!-- Destination specific policies using destination names or wildcards -->
        <destinationPolicy>
            <policyMap>
                <policyEntries>
                    <policyEntry queue=">" memoryLimit="5mb"/>
                    <policyEntry topic=">" memoryLimit="5mb">
                      <!-- you can add other policies too such as these
                        <dispatchPolicy>
                            <strictOrderDispatchPolicy/>
                        </dispatchPolicy>
                        <subscriptionRecoveryPolicy>
                            <lastImageSubscriptionRecoveryPolicy/>
                        </subscriptionRecoveryPolicy>
                      -->
                    </policyEntry>
                </policyEntries>
            </policyMap>
        </destinationPolicy>


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

        <networkConnectors>
            <networkConnector uri="multicast://default?group=${groupId}"/>
        </networkConnectors>        

        <persistenceAdapter>
            <amqPersistenceAdapter syncOnWrite="false" directory="./activemq-data" maxFileLength="20 mb"/>
        </persistenceAdapter>

        ${sslContext}

        <!--  The maximum about of space the broker will use before slowing down producers -->
        <systemUsage>
            <systemUsage>
                <memoryUsage>
                    <memoryUsage limit="20 mb"/>
                </memoryUsage>
                <storeUsage>
                    <storeUsage limit="1 gb" name="foo"/>
                </storeUsage>
                <tempUsage>
                    <tempUsage limit="100 mb"/>
                </tempUsage>
            </systemUsage>
        </systemUsage>

        <!-- The transport connectors ActiveMQ will listen to -->
        <transportConnectors>
            <transportConnector name="openwire" uri="${brokerURL}" discoveryUri="multicast://default?group=${groupId}" updateClusterClients="true" rebalanceClusterClients="true" updateClusterClientsOnRemove="true" />
        </transportConnectors>


    </broker>

</beans:beans>

And this is the maven filter being used:

brokerURL=tcp://0.0.0.0:61616
sslContext=
groupId=0

That's the last version we are using, if the client uses failover with direct ips it can connect to both of them, using discovery only one of the nodes (Windows XP) is found the other (Windows Server 2008) doesn't reply to the IGMP packet (all firewall disabled) and they don't connect to each other.

One of the known problems is the brokerName as I have read here that it can has variables in it but that doesn't seem to work outside a maven deploy, but not sure if it is the our only error or there are more.

I will add extra info if needed, just tell me.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜