My case is as follow, I have one master machine and 7 clients machine. I add
activemq between these machines. The clients machine send messages to the
master machines and the master machine send individual messages to each
client.  
I implement the following solution, I am using a queues structure as a
medium for communication. The solution works for only one client server, but
when I add another client to this architecture the activemq does not receive
any messages. until I turn off the first client. giving the following
exception.


javax.jms.InvalidClientIDException: Broker: localhost - Client:
NC_localhost_outbound already connected from tcp://0.0.0.77:59730


My configuration file:

<?xml version="1.0" encoding="UTF-8"?>
<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";>
  
  <bean id="environmentVariablesConfiguration"
class="org.jasypt.encryption.pbe.config.EnvironmentStringPBEConfig">
    <property name="algorithm" value="PBEWithMD5AndDES" />
    <property name="passwordEnvName" value="ACTIVEMQ_ENCRYPTION_PASSWORD" />
  </bean>
 
  <bean id="propertyConfigurer"
class="org.jasypt.spring.properties.EncryptablePropertyPlaceholderConfigurer"> 
      <constructor-arg ref="configurationEncryptor" /> 
      <property name="location"
value="file:${activemq.base}/conf/credentials-enc.properties"/> 
  </bean> 
  
  <bean id="configurationEncryptor"
class="org.jasypt.encryption.pbe.StandardPBEStringEncryptor">
     <property name="algorithm" value="PBEWithMD5AndDES"/>
     <property name="password" value="activemq"/>
  </bean> 
  
  <broker useJmx="true" persistent="false"
xmlns="http://activemq.apache.org/schema/core";
destroyApplicationContextOnStop="true">
   <destinationPolicy>
    <policyMap>
      <defaultEntry>
        <policyEntry topic="*">
          <subscriptionRecoveryPolicy>
            <timedSubscriptionRecoveryPolicy recoverDuration="3600000" />
          </subscriptionRecoveryPolicy>
        </policyEntry>
      </defaultEntry>
    </policyMap>
  </destinationPolicy>

    <managementContext>
        <managementContext createConnector="true">
            <property xmlns="http://www.springframework.org/schema/beans";
name="environment">
                <map xmlns="http://www.springframework.org/schema/beans";>
                    <entry
xmlns="http://www.springframework.org/schema/beans";
key="jmx.remote.x.password.file"
                           value="conf/jmx.password"/>
                    <entry
xmlns="http://www.springframework.org/schema/beans";
key="jmx.remote.x.access.file"
                           value="conf/jmx.access"/>
                </map>
            </property>
        </managementContext>
      </managementContext>
      
    <plugins>
        
        <simpleAuthenticationPlugin>
            <users>
                <authenticationUser username="system"
password="${activemq.password}" groups="users,admins"/>
               <authenticationUser username="user"
password="${user.password}"  groups="users"/> 
                <authenticationUser username="guest"
password="${guest.password}" groups="guests"/>
            </users>
        </simpleAuthenticationPlugin>


      
      <authorizationPlugin>
        <map>
          <authorizationMap>
            <authorizationEntries>
              <authorizationEntry queue=">" read="admins" write="admins"
admin="admins" />
              <authorizationEntry queue="USERS.>" read="users" write="users"
admin="users" />
       
                  <authorizationEntry queue="1000.>" read="users"
write="users" admin="users" />
                  <authorizationEntry queue="1001.>" read="users" write="users"
admin="users" />
                          
                  <authorizationEntry queue="Ack-reply.>" read="users" 
write="users"
admin="users" />
 
              <authorizationEntry queue="server1000.>" read="users" 
write="users"
admin="users" />

              <authorizationEntry queue="GUEST.>" read="guests"
write="guests,users" admin="guests,users" />
              <authorizationEntry queue="TEST.Q" read="guests"
write="guests" />
              <authorizationEntry topic=">" read="admins" write="admins"
admin="admins" />
              <authorizationEntry topic="USERS.>" read="users" write="users"
admin="users" />
              <authorizationEntry topic="GUEST.>" read="guests"
write="guests,users" admin="guests,users" />
              
              <authorizationEntry topic="ActiveMQ.Advisory.>" read="users"
write="users" admin="users"/>
              <authorizationEntry topic="ActiveMQ.Agent.>" read="users"
write="users" admin="users"/>
            </authorizationEntries>
          </authorizationMap>
        </map>
      </authorizationPlugin>
    </plugins>
    

      <systemUsage>
            <systemUsage>
                <memoryUsage>
                    <memoryUsage percentOfJvmHeap="70" />
                </memoryUsage>
                <storeUsage>
                    <storeUsage limit="10 gb"/>
                </storeUsage>
                <tempUsage>
                    <tempUsage limit="50 gb"/>
                </tempUsage>
            </systemUsage>
        </systemUsage>


    <transportConnectors>
       <transportConnector name="default" uri="tcp://0.0.0.0:61616"/>
    </transportConnectors>
    
  </broker>

   
  <commandAgent xmlns="http://activemq.apache.org/schema/core";
brokerUrl="vm://localhost" username="${activemq.username}"
password="${activemq.password}"/>
 
  <import resource="jetty.xml"/>
  <import resource="camel.xml"/>

</beans>
My environment is as follow : java 6, ubuntu12.04, activemq 5.10.2  

I have two questions : 
1- Why this exception happened ?
2- Is my configuration the best one in my this case, if no, what is the best
configuration ? 



--
View this message in context: 
http://activemq.2283324.n4.nabble.com/multiple-clients-one-server-architicture-using-queues-tp4695425.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Reply via email to