You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@servicemix.apache.org by Jamie Penney <jp...@ec.auckland.ac.nz> on 2007/12/04 07:17:24 UTC

Clustering problems

Hi all,
I wrote a small application as part of a bit of research I am doing on 
ServiceMix, and now I need to split the different parts of it onto 3 
different machines. However my 3 ServiceMix instances do not seem to be 
connecting to each other. To test this I wrote a very simple "echo" 
bean, and created an HTTP service unit that would send soap messages to 
it. If these two endpoints are on different ServiceMix instances, they 
cannot see each other (contrary to the "cluster" example, which seems to 
work without any additional configuration). I even tried using the 
configuration files from the cluster example, deployed my service 
assemblies to it and they still cannot see each other. All I get is this 
back from jetty:

STATUS: 500
<?xml version='1.0' encoding='UTF-8'?>
 <e:Envelope xmlns:e="http://schemas.xmlsoap.org/soap/envelope/">
  <e:Body>
   <e:Fault>
    <faultcode>e:Server</faultcode>
    <faultstring>java.lang.NullPointerException</faultstring>
   </e:Fault>
  </e:Body>
 </e:Envelope>

There is no exception logged - nothing to indicate the message even went 
through. Here is the message I sent to it:
<?xml version="1.0" encoding="UTF-8"?>
<e:Envelope xmlns:e="http://schemas.xmlsoap.org/soap/envelope/">
  <e:Body>
    <ping>
      <pingRequest>
        <message xmlns="http://soap">hel lo</message>
      </pingRequest>
    </ping>
  </e:Body>
</e:Envelope>

My servicemix.xml file is at the end of this message. I have checked the 
service names of my endpoints many times - this example works if the two 
service assemblies are in the same ServiceMix instance, or even in two 
instances on the same machine. It is only if they are on separate 
machines that there is a problem.

Is there some ActiveMQ configuration option I am overlooking? Does 
anybody have an idea as to what could be going wrong?

Thanks,
Jamie Penney

servicemix.xml:

<beans xmlns:sm="http://servicemix.apache.org/config/1.0"
       xmlns:audit="http://servicemix.apache.org/audit/1.0"
       xmlns:amq="http://activemq.org/config/1.0">

    <bean id="jndi" 
class="org.apache.xbean.spring.jndi.SpringInitialContextFactory"
        factory-method="makeInitialContext" singleton="true" />

        <!-- the JBI container -->
    <sm:container id="jbi"
            name="machine3"
            flowName="jms"
            useMBeanServer="true"
            createMBeanServer="true"
            createJmxConnector="true"
            persistent="true"
            rmiPort="1113">
    <sm:activationSpecs>

    </sm:activationSpecs>
  </sm:container>
 
    <!-- ActiveMQ JMS Broker configuration -->
  <amq:broker brokerName="broker3">
    <amq:managementContext>
      <bean class="org.apache.activemq.broker.jmx.ManagementContext">
        <property name="createConnector" value="false" />
      </bean>
    </amq:managementContext>

    <!-- Use journaled JDBC persistence -->
    <amq:persistenceAdapter>
        <memoryPersistenceAdapter/>
    </amq:persistenceAdapter>
 
    <amq:transportConnectors>
       <amq:transportConnector uri="tcp://localhost:61616" 
discoveryUri="multicast://default"/>
    </amq:transportConnectors>
   
    <amq:networkConnectors>
      <!-- by default just auto discover the other brokers  -->
      <amq:networkConnector uri="multicast://default"/>
    </amq:networkConnectors>

  </amq:broker>
</beans>

Re: Clustering problems

Posted by Jamie Penney <jp...@ec.auckland.ac.nz>.
I have managed to sort the whole problem out. As far as I can tell the 
problem was fixed by:
1) Reverting all configuration files back to standard and adding names 
to each ServiceMix container.
2) Adding static network connectors to the ActiveMQ config.
3) The HTTP consumer delivered messages to a bean that used to reside on 
another instance. I moved this bean to the same instance as the HTTP 
consumer (more on this later).
4) Updated to version 3.2.1

Before I did item 3, nothing would work at all. Jetty would log an error 
about not being able to write non xml errors to a non soap endpoint, and 
that was it. It seems like the HTTP consumer is not able to start 
message exchanges with remote endpoints. Is this the correct behaviour?

Also I'm not 100% sure that upgrading helped, but it definitely wasn't 
working before the upgrade so I suspect that it might have.

There is a little more information on my blog if anyone is interested. 
Thanks for the help.
-- 
Jamie Penney

www.jamiepenney.co.nz <http://www.jamiepenney.co.nz/>


Jamie Penney wrote:
> Hi all,
> I wrote a small application as part of a bit of research I am doing on 
> ServiceMix, and now I need to split the different parts of it onto 3 
> different machines. However my 3 ServiceMix instances do not seem to 
> be connecting to each other. To test this I wrote a very simple "echo" 
> bean, and created an HTTP service unit that would send soap messages 
> to it. If these two endpoints are on different ServiceMix instances, 
> they cannot see each other (contrary to the "cluster" example, which 
> seems to work without any additional configuration). I even tried 
> using the configuration files from the cluster example, deployed my 
> service assemblies to it and they still cannot see each other. All I 
> get is this back from jetty:
>
> STATUS: 500
> <?xml version='1.0' encoding='UTF-8'?>
> <e:Envelope xmlns:e="http://schemas.xmlsoap.org/soap/envelope/">
>  <e:Body>
>   <e:Fault>
>    <faultcode>e:Server</faultcode>
>    <faultstring>java.lang.NullPointerException</faultstring>
>   </e:Fault>
>  </e:Body>
> </e:Envelope>
>
> There is no exception logged - nothing to indicate the message even 
> went through. Here is the message I sent to it:
> <?xml version="1.0" encoding="UTF-8"?>
> <e:Envelope xmlns:e="http://schemas.xmlsoap.org/soap/envelope/">
>  <e:Body>
>    <ping>
>      <pingRequest>
>        <message xmlns="http://soap">hel lo</message>
>      </pingRequest>
>    </ping>
>  </e:Body>
> </e:Envelope>
>
> My servicemix.xml file is at the end of this message. I have checked 
> the service names of my endpoints many times - this example works if 
> the two service assemblies are in the same ServiceMix instance, or 
> even in two instances on the same machine. It is only if they are on 
> separate machines that there is a problem.
>
> Is there some ActiveMQ configuration option I am overlooking? Does 
> anybody have an idea as to what could be going wrong?
>
> Thanks,
> Jamie Penney
>
> servicemix.xml:
>
> <beans xmlns:sm="http://servicemix.apache.org/config/1.0"
>       xmlns:audit="http://servicemix.apache.org/audit/1.0"
>       xmlns:amq="http://activemq.org/config/1.0">
>
>    <bean id="jndi" 
> class="org.apache.xbean.spring.jndi.SpringInitialContextFactory"
>        factory-method="makeInitialContext" singleton="true" />
>
>        <!-- the JBI container -->
>    <sm:container id="jbi"
>            name="machine3"
>            flowName="jms"
>            useMBeanServer="true"
>            createMBeanServer="true"
>            createJmxConnector="true"
>            persistent="true"
>            rmiPort="1113">
>    <sm:activationSpecs>
>
>    </sm:activationSpecs>
>  </sm:container>
>
>    <!-- ActiveMQ JMS Broker configuration -->
>  <amq:broker brokerName="broker3">
>    <amq:managementContext>
>      <bean class="org.apache.activemq.broker.jmx.ManagementContext">
>        <property name="createConnector" value="false" />
>      </bean>
>    </amq:managementContext>
>
>    <!-- Use journaled JDBC persistence -->
>    <amq:persistenceAdapter>
>        <memoryPersistenceAdapter/>
>    </amq:persistenceAdapter>
>
>    <amq:transportConnectors>
>       <amq:transportConnector uri="tcp://localhost:61616" 
> discoveryUri="multicast://default"/>
>    </amq:transportConnectors>
>      <amq:networkConnectors>
>      <!-- by default just auto discover the other brokers  -->
>      <amq:networkConnector uri="multicast://default"/>
>    </amq:networkConnectors>
>
>  </amq:broker>
> </beans>

Re: Clustering problems

Posted by Guillaume Nodet <gn...@gmail.com>.
Have you raised the log level to debug (in conf/log4j.xml) and look at the
log (in data/log/servicemix.log) to see what happens ?
I'm sure you'll see an exception.   Please post it as it usually contains
enough information to find the problem.

On Dec 7, 2007 12:29 AM, Jamie Penney <jp...@ec.auckland.ac.nz> wrote:

> I have posted about this on my blog - if someone would like to look at
> the linked file (or download it directly from here:
> http://www.jamiepenney.co.nz/twiki/pub/Main/ServiceMix/echoexample.zip)
> then I would be grateful.
>
> Thanks,
> Jamie Penney
>
> Jamie Penney wrote:
> > The clustering demos work fine across my network. However if I run
> > those files and deploy my service assemblies to them, they don't work.
> > If my service assemblies are on the same servicemix instance or on two
> > instances on the same machine, it works fine.
> >
> > Thanks,
> > Jamie
> >
> > Guillaume Nodet wrote:
> >> There are two demos that use clustering in the ServiceMix distribtion.
> >> Can you first try those and see what happens ? If they fail, this is
> >> certainly your environment.  If they work, this means that your own
> >> demos
> >> have some problems.
> >> Knowing where to look would be a good start.
> >>
> >> On Dec 6, 2007 2:20 PM, Jamie Penney <jp...@ec.auckland.ac.nz> wrote:
> >>
> >>
> >>> Still no luck. Using the basic echo example I set up the other day, I
> >>> get a "Could not find route for exchange" error. At one point I got
> the
> >>> NullPointerException that I described the other day, but that stopped
> >>> happening and I got the no route exception again.
> >>> I assume the ActiveMQ instances are talking to each other as it
> >>> complains about not being able to connect to the other instance until
> >>> they are both up and running. I have made sure that both the
> ServiceMix
> >>> instances and ActiveMQ instances have different names, and according
> to
> >>> netstat they are connected. Is there some indication in JConsole that
> >>> the instances are connected, because I cannot find any reference to
> the
> >>> other instance on either machine. They are able to connect to each
> >>> other, I have disabled all firewalls on both machines, I don't know
> >>> what
> >>> else to try :-(
> >>>
> >>> Thanks,
> >>> Jamie Penney
> >>>
> >>>
> >>> Jamie Penney wrote:
> >>>
> >>>> Aha! I had tried the static configuration thing previously and it
> >>>> hadn't worked. I will give this a try and get back to you.
> >>>>
> >>>> Many thanks,
> >>>> Jamie
> >>>>
> >>>>
> >>>> Bruce Snyder wrote:
> >>>>
> >>>>> It's very common to not allow multicast to be used on a network.
> It's
> >>>>> rather chatty so network admins don't like it. I'd suggest not
> >>>>> worrying about this too much and moving on to using specific
> >>>>> addresses
> >>>>> for each broker via networkConnector elements as we're discussing
> >>>>> below.
> >>>>>
> >>>>>
> >>>>>
> >>>>>> 2) The example on that page is a little unclear. There are two
> parts
> >>>>>> here:
> >>>>>>
> >>>>>>     <transportConnectors>
> >>>>>>       <transportConnector uri="tcp://localhost:62002"/>
> >>>>>>     </transportConnectors>
> >>>>>>
> >>>>>>     <networkConnectors>
> >>>>>>       <networkConnector uri="static:(tcp://localhost:62001)"/>
> >>>>>>     </networkConnectors>
> >>>>>>
> >>>>>> Which of these is the local activemq instance and which is the
> >>>>>> remote?
> >>>>>> Assume my machines are 192.168.1.1, 192.168.1.2, and 192.168.1.3,
> >>>>>> could I
> >>>>>> use the following configuration:
> >>>>>>
> >>>>>>     <transportConnectors>
> >>>>>>       <transportConnector uri="tcp://localhost:61616"/>
> >>>>>>     </transportConnectors>
> >>>>>>
> >>>>>>     <networkConnectors>
> >>>>>>       <networkConnector
> >>>>>> uri="static:(tcp://192.168.1.2:61616,tcp://192.168.1.3:61616)"/>
> >>>>>>     </networkConnectors>
> >>>>>>
> >>>>>>
> >>>>> The configuration above will only connect to one of .2 or .3, not
> >>>>> both
> >>>>> at the same time. Here's what you need:
> >>>>>
> >>>>> <networkConnectors>
> >>>>>   <networkConnector uri="tcp://192.168.1.2:61616" />
> >>>>>   <networkConnector uri="tcp://192.168.1.3:61616)" />
> >>>>> </networkConnectors>
> >>>>>
> >>>>> And in the same manner, .2 will need to point at both .1 and .3; and
> >>>>> .3 will need to point at both .1 and .2.
> >>>>>
> >>>>> Bruce
> >>>>>
> >>>>>
> >>>
> >>
> >>
> >>
> >
>
>


-- 
Cheers,
Guillaume Nodet
------------------------
Blog: http://gnodet.blogspot.com/

Re: Clustering problems

Posted by Jamie Penney <jp...@ec.auckland.ac.nz>.
I have posted about this on my blog - if someone would like to look at 
the linked file (or download it directly from here: 
http://www.jamiepenney.co.nz/twiki/pub/Main/ServiceMix/echoexample.zip) 
then I would be grateful.

Thanks,
Jamie Penney

Jamie Penney wrote:
> The clustering demos work fine across my network. However if I run 
> those files and deploy my service assemblies to them, they don't work. 
> If my service assemblies are on the same servicemix instance or on two 
> instances on the same machine, it works fine.
>
> Thanks,
> Jamie
>
> Guillaume Nodet wrote:
>> There are two demos that use clustering in the ServiceMix distribtion.
>> Can you first try those and see what happens ? If they fail, this is
>> certainly your environment.  If they work, this means that your own 
>> demos
>> have some problems.
>> Knowing where to look would be a good start.
>>
>> On Dec 6, 2007 2:20 PM, Jamie Penney <jp...@ec.auckland.ac.nz> wrote:
>>
>>  
>>> Still no luck. Using the basic echo example I set up the other day, I
>>> get a "Could not find route for exchange" error. At one point I got the
>>> NullPointerException that I described the other day, but that stopped
>>> happening and I got the no route exception again.
>>> I assume the ActiveMQ instances are talking to each other as it
>>> complains about not being able to connect to the other instance until
>>> they are both up and running. I have made sure that both the ServiceMix
>>> instances and ActiveMQ instances have different names, and according to
>>> netstat they are connected. Is there some indication in JConsole that
>>> the instances are connected, because I cannot find any reference to the
>>> other instance on either machine. They are able to connect to each
>>> other, I have disabled all firewalls on both machines, I don't know 
>>> what
>>> else to try :-(
>>>
>>> Thanks,
>>> Jamie Penney
>>>
>>>
>>> Jamie Penney wrote:
>>>    
>>>> Aha! I had tried the static configuration thing previously and it
>>>> hadn't worked. I will give this a try and get back to you.
>>>>
>>>> Many thanks,
>>>> Jamie
>>>>
>>>>
>>>> Bruce Snyder wrote:
>>>>      
>>>>> It's very common to not allow multicast to be used on a network. It's
>>>>> rather chatty so network admins don't like it. I'd suggest not
>>>>> worrying about this too much and moving on to using specific 
>>>>> addresses
>>>>> for each broker via networkConnector elements as we're discussing
>>>>> below.
>>>>>
>>>>>
>>>>>        
>>>>>> 2) The example on that page is a little unclear. There are two parts
>>>>>> here:
>>>>>>
>>>>>>     <transportConnectors>
>>>>>>       <transportConnector uri="tcp://localhost:62002"/>
>>>>>>     </transportConnectors>
>>>>>>
>>>>>>     <networkConnectors>
>>>>>>       <networkConnector uri="static:(tcp://localhost:62001)"/>
>>>>>>     </networkConnectors>
>>>>>>
>>>>>> Which of these is the local activemq instance and which is the 
>>>>>> remote?
>>>>>> Assume my machines are 192.168.1.1, 192.168.1.2, and 192.168.1.3,
>>>>>> could I
>>>>>> use the following configuration:
>>>>>>
>>>>>>     <transportConnectors>
>>>>>>       <transportConnector uri="tcp://localhost:61616"/>
>>>>>>     </transportConnectors>
>>>>>>
>>>>>>     <networkConnectors>
>>>>>>       <networkConnector
>>>>>> uri="static:(tcp://192.168.1.2:61616,tcp://192.168.1.3:61616)"/>
>>>>>>     </networkConnectors>
>>>>>>
>>>>>>           
>>>>> The configuration above will only connect to one of .2 or .3, not 
>>>>> both
>>>>> at the same time. Here's what you need:
>>>>>
>>>>> <networkConnectors>
>>>>>   <networkConnector uri="tcp://192.168.1.2:61616" />
>>>>>   <networkConnector uri="tcp://192.168.1.3:61616)" />
>>>>> </networkConnectors>
>>>>>
>>>>> And in the same manner, .2 will need to point at both .1 and .3; and
>>>>> .3 will need to point at both .1 and .2.
>>>>>
>>>>> Bruce
>>>>>
>>>>>         
>>>     
>>
>>
>>   
>


Re: Clustering problems

Posted by Jamie Penney <jp...@ec.auckland.ac.nz>.
The clustering demos work fine across my network. However if I run those 
files and deploy my service assemblies to them, they don't work. If my 
service assemblies are on the same servicemix instance or on two 
instances on the same machine, it works fine.

Thanks,
Jamie

Guillaume Nodet wrote:
> There are two demos that use clustering in the ServiceMix distribtion.
> Can you first try those and see what happens ? If they fail, this is
> certainly your environment.  If they work, this means that your own demos
> have some problems.
> Knowing where to look would be a good start.
>
> On Dec 6, 2007 2:20 PM, Jamie Penney <jp...@ec.auckland.ac.nz> wrote:
>
>   
>> Still no luck. Using the basic echo example I set up the other day, I
>> get a "Could not find route for exchange" error. At one point I got the
>> NullPointerException that I described the other day, but that stopped
>> happening and I got the no route exception again.
>> I assume the ActiveMQ instances are talking to each other as it
>> complains about not being able to connect to the other instance until
>> they are both up and running. I have made sure that both the ServiceMix
>> instances and ActiveMQ instances have different names, and according to
>> netstat they are connected. Is there some indication in JConsole that
>> the instances are connected, because I cannot find any reference to the
>> other instance on either machine. They are able to connect to each
>> other, I have disabled all firewalls on both machines, I don't know what
>> else to try :-(
>>
>> Thanks,
>> Jamie Penney
>>
>>
>> Jamie Penney wrote:
>>     
>>> Aha! I had tried the static configuration thing previously and it
>>> hadn't worked. I will give this a try and get back to you.
>>>
>>> Many thanks,
>>> Jamie
>>>
>>>
>>> Bruce Snyder wrote:
>>>       
>>>> It's very common to not allow multicast to be used on a network. It's
>>>> rather chatty so network admins don't like it. I'd suggest not
>>>> worrying about this too much and moving on to using specific addresses
>>>> for each broker via networkConnector elements as we're discussing
>>>> below.
>>>>
>>>>
>>>>         
>>>>> 2) The example on that page is a little unclear. There are two parts
>>>>> here:
>>>>>
>>>>>     <transportConnectors>
>>>>>       <transportConnector uri="tcp://localhost:62002"/>
>>>>>     </transportConnectors>
>>>>>
>>>>>     <networkConnectors>
>>>>>       <networkConnector uri="static:(tcp://localhost:62001)"/>
>>>>>     </networkConnectors>
>>>>>
>>>>> Which of these is the local activemq instance and which is the remote?
>>>>> Assume my machines are 192.168.1.1, 192.168.1.2, and 192.168.1.3,
>>>>> could I
>>>>> use the following configuration:
>>>>>
>>>>>     <transportConnectors>
>>>>>       <transportConnector uri="tcp://localhost:61616"/>
>>>>>     </transportConnectors>
>>>>>
>>>>>     <networkConnectors>
>>>>>       <networkConnector
>>>>> uri="static:(tcp://192.168.1.2:61616,tcp://192.168.1.3:61616)"/>
>>>>>     </networkConnectors>
>>>>>
>>>>>           
>>>> The configuration above will only connect to one of .2 or .3, not both
>>>> at the same time. Here's what you need:
>>>>
>>>> <networkConnectors>
>>>>   <networkConnector uri="tcp://192.168.1.2:61616" />
>>>>   <networkConnector uri="tcp://192.168.1.3:61616)" />
>>>> </networkConnectors>
>>>>
>>>> And in the same manner, .2 will need to point at both .1 and .3; and
>>>> .3 will need to point at both .1 and .2.
>>>>
>>>> Bruce
>>>>
>>>>         
>>     
>
>
>   


Re: Clustering problems

Posted by Guillaume Nodet <gn...@gmail.com>.
There are two demos that use clustering in the ServiceMix distribtion.
Can you first try those and see what happens ? If they fail, this is
certainly your environment.  If they work, this means that your own demos
have some problems.
Knowing where to look would be a good start.

On Dec 6, 2007 2:20 PM, Jamie Penney <jp...@ec.auckland.ac.nz> wrote:

> Still no luck. Using the basic echo example I set up the other day, I
> get a "Could not find route for exchange" error. At one point I got the
> NullPointerException that I described the other day, but that stopped
> happening and I got the no route exception again.
> I assume the ActiveMQ instances are talking to each other as it
> complains about not being able to connect to the other instance until
> they are both up and running. I have made sure that both the ServiceMix
> instances and ActiveMQ instances have different names, and according to
> netstat they are connected. Is there some indication in JConsole that
> the instances are connected, because I cannot find any reference to the
> other instance on either machine. They are able to connect to each
> other, I have disabled all firewalls on both machines, I don't know what
> else to try :-(
>
> Thanks,
> Jamie Penney
>
>
> Jamie Penney wrote:
> > Aha! I had tried the static configuration thing previously and it
> > hadn't worked. I will give this a try and get back to you.
> >
> > Many thanks,
> > Jamie
> >
> >
> > Bruce Snyder wrote:
> >> It's very common to not allow multicast to be used on a network. It's
> >> rather chatty so network admins don't like it. I'd suggest not
> >> worrying about this too much and moving on to using specific addresses
> >> for each broker via networkConnector elements as we're discussing
> >> below.
> >>
> >>
> >>> 2) The example on that page is a little unclear. There are two parts
> >>> here:
> >>>
> >>>     <transportConnectors>
> >>>       <transportConnector uri="tcp://localhost:62002"/>
> >>>     </transportConnectors>
> >>>
> >>>     <networkConnectors>
> >>>       <networkConnector uri="static:(tcp://localhost:62001)"/>
> >>>     </networkConnectors>
> >>>
> >>> Which of these is the local activemq instance and which is the remote?
> >>> Assume my machines are 192.168.1.1, 192.168.1.2, and 192.168.1.3,
> >>> could I
> >>> use the following configuration:
> >>>
> >>>     <transportConnectors>
> >>>       <transportConnector uri="tcp://localhost:61616"/>
> >>>     </transportConnectors>
> >>>
> >>>     <networkConnectors>
> >>>       <networkConnector
> >>> uri="static:(tcp://192.168.1.2:61616,tcp://192.168.1.3:61616)"/>
> >>>     </networkConnectors>
> >>>
> >>
> >> The configuration above will only connect to one of .2 or .3, not both
> >> at the same time. Here's what you need:
> >>
> >> <networkConnectors>
> >>   <networkConnector uri="tcp://192.168.1.2:61616" />
> >>   <networkConnector uri="tcp://192.168.1.3:61616)" />
> >> </networkConnectors>
> >>
> >> And in the same manner, .2 will need to point at both .1 and .3; and
> >> .3 will need to point at both .1 and .2.
> >>
> >> Bruce
> >>
> >
>
>


-- 
Cheers,
Guillaume Nodet
------------------------
Blog: http://gnodet.blogspot.com/

Re: Clustering problems

Posted by Jamie Penney <jp...@ec.auckland.ac.nz>.
Still no luck. Using the basic echo example I set up the other day, I 
get a "Could not find route for exchange" error. At one point I got the 
NullPointerException that I described the other day, but that stopped 
happening and I got the no route exception again.
I assume the ActiveMQ instances are talking to each other as it 
complains about not being able to connect to the other instance until 
they are both up and running. I have made sure that both the ServiceMix 
instances and ActiveMQ instances have different names, and according to 
netstat they are connected. Is there some indication in JConsole that 
the instances are connected, because I cannot find any reference to the 
other instance on either machine. They are able to connect to each 
other, I have disabled all firewalls on both machines, I don't know what 
else to try :-(

Thanks,
Jamie Penney


Jamie Penney wrote:
> Aha! I had tried the static configuration thing previously and it 
> hadn't worked. I will give this a try and get back to you.
>
> Many thanks,
> Jamie
>
>
> Bruce Snyder wrote:
>> It's very common to not allow multicast to be used on a network. It's
>> rather chatty so network admins don't like it. I'd suggest not
>> worrying about this too much and moving on to using specific addresses
>> for each broker via networkConnector elements as we're discussing
>> below.
>>
>>  
>>> 2) The example on that page is a little unclear. There are two parts 
>>> here:
>>>
>>>     <transportConnectors>
>>>       <transportConnector uri="tcp://localhost:62002"/>
>>>     </transportConnectors>
>>>
>>>     <networkConnectors>
>>>       <networkConnector uri="static:(tcp://localhost:62001)"/>
>>>     </networkConnectors>
>>>
>>> Which of these is the local activemq instance and which is the remote?
>>> Assume my machines are 192.168.1.1, 192.168.1.2, and 192.168.1.3, 
>>> could I
>>> use the following configuration:
>>>
>>>     <transportConnectors>
>>>       <transportConnector uri="tcp://localhost:61616"/>
>>>     </transportConnectors>
>>>
>>>     <networkConnectors>
>>>       <networkConnector 
>>> uri="static:(tcp://192.168.1.2:61616,tcp://192.168.1.3:61616)"/>
>>>     </networkConnectors>
>>>     
>>
>> The configuration above will only connect to one of .2 or .3, not both
>> at the same time. Here's what you need:
>>
>> <networkConnectors>
>>   <networkConnector uri="tcp://192.168.1.2:61616" />
>>   <networkConnector uri="tcp://192.168.1.3:61616)" />
>> </networkConnectors>
>>
>> And in the same manner, .2 will need to point at both .1 and .3; and
>> .3 will need to point at both .1 and .2.
>>
>> Bruce
>>   
>


Re: Clustering problems

Posted by Jamie Penney <jp...@ec.auckland.ac.nz>.
Aha! I had tried the static configuration thing previously and it hadn't 
worked. I will give this a try and get back to you.

Many thanks,
Jamie


Bruce Snyder wrote:
> It's very common to not allow multicast to be used on a network. It's
> rather chatty so network admins don't like it. I'd suggest not
> worrying about this too much and moving on to using specific addresses
> for each broker via networkConnector elements as we're discussing
> below.
>
>   
>> 2) The example on that page is a little unclear. There are two parts here:
>>
>>     <transportConnectors>
>>       <transportConnector uri="tcp://localhost:62002"/>
>>     </transportConnectors>
>>
>>     <networkConnectors>
>>       <networkConnector uri="static:(tcp://localhost:62001)"/>
>>     </networkConnectors>
>>
>> Which of these is the local activemq instance and which is the remote?
>> Assume my machines are 192.168.1.1, 192.168.1.2, and 192.168.1.3, could I
>> use the following configuration:
>>
>>     <transportConnectors>
>>       <transportConnector uri="tcp://localhost:61616"/>
>>     </transportConnectors>
>>
>>     <networkConnectors>
>>       <networkConnector uri="static:(tcp://192.168.1.2:61616,tcp://192.168.1.3:61616)"/>
>>     </networkConnectors>
>>     
>
> The configuration above will only connect to one of .2 or .3, not both
> at the same time. Here's what you need:
>
> <networkConnectors>
>   <networkConnector uri="tcp://192.168.1.2:61616" />
>   <networkConnector uri="tcp://192.168.1.3:61616)" />
> </networkConnectors>
>
> And in the same manner, .2 will need to point at both .1 and .3; and
> .3 will need to point at both .1 and .2.
>
> Bruce
>   


Re: Clustering problems

Posted by Bruce Snyder <br...@gmail.com>.
On Dec 5, 2007 11:46 PM, Jamie Penney <jp...@ec.auckland.ac.nz> wrote:
> Ok that raises two questions.
> 1) How can I determine whether multicast can be used on my network (it's
> going to be on 3 vmware virtual machines so that should be consistent).

It's very common to not allow multicast to be used on a network. It's
rather chatty so network admins don't like it. I'd suggest not
worrying about this too much and moving on to using specific addresses
for each broker via networkConnector elements as we're discussing
below.

> 2) The example on that page is a little unclear. There are two parts here:
>
>     <transportConnectors>
>       <transportConnector uri="tcp://localhost:62002"/>
>     </transportConnectors>
>
>     <networkConnectors>
>       <networkConnector uri="static:(tcp://localhost:62001)"/>
>     </networkConnectors>
>
> Which of these is the local activemq instance and which is the remote?
> Assume my machines are 192.168.1.1, 192.168.1.2, and 192.168.1.3, could I
> use the following configuration:
>
>     <transportConnectors>
>       <transportConnector uri="tcp://localhost:61616"/>
>     </transportConnectors>
>
>     <networkConnectors>
>       <networkConnector uri="static:(tcp://192.168.1.2:61616,tcp://192.168.1.3:61616)"/>
>     </networkConnectors>

The configuration above will only connect to one of .2 or .3, not both
at the same time. Here's what you need:

<networkConnectors>
  <networkConnector uri="tcp://192.168.1.2:61616" />
  <networkConnector uri="tcp://192.168.1.3:61616)" />
</networkConnectors>

And in the same manner, .2 will need to point at both .1 and .3; and
.3 will need to point at both .1 and .2.

Bruce
-- 
perl -e 'print unpack("u30","D0G)U8V4\@4VYY9&5R\"F)R=6-E+G-N>61E<D\!G;6%I;\"YC;VT*"
);'

Apache ActiveMQ - http://activemq.org/
Apache ServiceMix - http://servicemix.org/
Apache Geronimo - http://geronimo.apache.org/

http://bruceblog.org/

Re: Clustering problems

Posted by Jamie Penney <jp...@ec.auckland.ac.nz>.
Ok that raises two questions.
1) How can I determine whether multicast can be used on my network (it's 
going to be on 3 vmware virtual machines so that should be consistent).
2) The example on that page is a little unclear. There are two parts here:

    <transportConnectors>
      <transportConnector uri="tcp://localhost:62002"/>
    </transportConnectors>

    <networkConnectors>
      <networkConnector uri="static:(tcp://localhost:62001)"/>
    </networkConnectors>

Which of these is the local activemq instance and which is the remote? 
Assume my machines are 192.168.1.1, 192.168.1.2, and 192.168.1.3, could I
use the following configuration:

    <transportConnectors>
      <transportConnector uri="tcp://localhost:61616"/>
    </transportConnectors>

    <networkConnectors>
      <networkConnector uri="static:(tcp://192.168.1.2:61616,tcp://192.168.1.3:61616)"/>
    </networkConnectors>

Thanks,
Jamie

Bruce Snyder wrote:
> On Dec 5, 2007 11:31 PM, Jamie Penney <jp...@ec.auckland.ac.nz> wrote:
>   
>> I've just been using the default configuration (for 3.1.2 anyway). I am
>> bringing my two machines up to 3.2.1 now just in case that fixes it, but
>> here is the activemq.xml file in my conf directory:
>>     
> ...
>   
>>     <amq:networkConnectors>
>>       <amq:networkConnector uri="multicast://default"/>
>>     </amq:networkConnectors>
>>     
>
> Just as I suspected, you're using the default networkConnector
> configuration that uses multicast. Are you sure that you can use
> multicast on your network?
>
> To work around this, you'll have to specify a networkConnector
> pointing to the other two ServiceMix instances. And because the
> networkConnector object is still only uni-directional, you'll need to
> configure a networkConnector pointing in both directions on each
> instance so the three brokers can all see one another. What you're
> doing here is configuring a network of brokers
> (http://activemq.apache.org/networks-of-brokers.html) with ActiveMQ so
> you can establish broker-to-broker communication.
>
> Bruce
>   


Re: Clustering problems

Posted by Bruce Snyder <br...@gmail.com>.
On Dec 5, 2007 11:31 PM, Jamie Penney <jp...@ec.auckland.ac.nz> wrote:
> I've just been using the default configuration (for 3.1.2 anyway). I am
> bringing my two machines up to 3.2.1 now just in case that fixes it, but
> here is the activemq.xml file in my conf directory:
...
>     <amq:networkConnectors>
>       <amq:networkConnector uri="multicast://default"/>
>     </amq:networkConnectors>

Just as I suspected, you're using the default networkConnector
configuration that uses multicast. Are you sure that you can use
multicast on your network?

To work around this, you'll have to specify a networkConnector
pointing to the other two ServiceMix instances. And because the
networkConnector object is still only uni-directional, you'll need to
configure a networkConnector pointing in both directions on each
instance so the three brokers can all see one another. What you're
doing here is configuring a network of brokers
(http://activemq.apache.org/networks-of-brokers.html) with ActiveMQ so
you can establish broker-to-broker communication.

Bruce
-- 
perl -e 'print unpack("u30","D0G)U8V4\@4VYY9&5R\"F)R=6-E+G-N>61E<D\!G;6%I;\"YC;VT*"
);'

Apache ActiveMQ - http://activemq.org/
Apache ServiceMix - http://servicemix.org/
Apache Geronimo - http://geronimo.apache.org/

http://bruceblog.org/

Re: Clustering problems

Posted by Jamie Penney <jp...@ec.auckland.ac.nz>.
I've just been using the default configuration (for 3.1.2 anyway). I am 
bringing my two machines up to 3.2.1 now just in case that fixes it, but 
here is the activemq.xml file in my conf directory:

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns:amq="http://activemq.org/config/1.0">
 
  <amq:broker depends-on="jmxServer">
    <amq:managementContext>
      <bean class="org.apache.activemq.broker.jmx.ManagementContext">
        <property name="createConnector" value="false" />
      </bean>
    </amq:managementContext>

    <!-- Use journaled JDBC persistence -->
    <amq:persistenceAdapter>
      <amq:journaledJDBC journalLogFiles="5" dataDirectory="./data/amq"/>
    </amq:persistenceAdapter>
 
    <amq:transportConnectors>
       <amq:transportConnector uri="tcp://localhost:61616" 
discoveryUri="multicast://default"/>
    </amq:transportConnectors>
   
    <amq:networkConnectors>
      <amq:networkConnector uri="multicast://default"/>
    </amq:networkConnectors>
   
  </amq:broker>

</beans>



Bruce Snyder wrote:
> Because you said that your echo example works when the SAs are deploy
> to the same instance of ServiceMix, the issue appears to be with
> either the ActiveMQ configuration or the network. Please post your
> activemq.xml file so we can start there.
>
> Bruce
>   


Re: Clustering problems

Posted by Bruce Snyder <br...@gmail.com>.
On Dec 5, 2007 9:01 PM, Jamie Penney <jp...@ec.auckland.ac.nz> wrote:
> Sorry for the bump, but I'm really quite stuck here and this could be a
> show stopper. What I have narrowed it down to is that ServiceMix seems
> to only allow communication between statically deployed components, not
> hot deployed ones. Is this the problem? If so, what is the easiest way
> to convert my maven projects to a statically deployed scenario? Is it
> possible to just copy and paste the bean information from the xbean.xml
> files to a single servicemix.xml file?

Because you said that your echo example works when the SAs are deploy
to the same instance of ServiceMix, the issue appears to be with
either the ActiveMQ configuration or the network. Please post your
activemq.xml file so we can start there.

Bruce
-- 
perl -e 'print unpack("u30","D0G)U8V4\@4VYY9&5R\"F)R=6-E+G-N>61E<D\!G;6%I;\"YC;VT*"
);'

Apache ActiveMQ - http://activemq.org/
Apache ServiceMix - http://servicemix.org/
Apache Geronimo - http://geronimo.apache.org/

http://bruceblog.org/

Re: Clustering problems

Posted by Jamie Penney <jp...@ec.auckland.ac.nz>.
Sorry for the bump, but I'm really quite stuck here and this could be a 
show stopper. What I have narrowed it down to is that ServiceMix seems 
to only allow communication between statically deployed components, not 
hot deployed ones. Is this the problem? If so, what is the easiest way 
to convert my maven projects to a statically deployed scenario? Is it 
possible to just copy and paste the bean information from the xbean.xml 
files to a single servicemix.xml file?

Thanks,
Jamie


Jamie Penney wrote:
> Hi all,
> I wrote a small application as part of a bit of research I am doing on 
> ServiceMix, and now I need to split the different parts of it onto 3 
> different machines. However my 3 ServiceMix instances do not seem to 
> be connecting to each other. To test this I wrote a very simple "echo" 
> bean, and created an HTTP service unit that would send soap messages 
> to it. If these two endpoints are on different ServiceMix instances, 
> they cannot see each other (contrary to the "cluster" example, which 
> seems to work without any additional configuration). I even tried 
> using the configuration files from the cluster example, deployed my 
> service assemblies to it and they still cannot see each other. All I 
> get is this back from jetty:
>
> STATUS: 500
> <?xml version='1.0' encoding='UTF-8'?>
> <e:Envelope xmlns:e="http://schemas.xmlsoap.org/soap/envelope/">
>  <e:Body>
>   <e:Fault>
>    <faultcode>e:Server</faultcode>
>    <faultstring>java.lang.NullPointerException</faultstring>
>   </e:Fault>
>  </e:Body>
> </e:Envelope>
>
> There is no exception logged - nothing to indicate the message even 
> went through. Here is the message I sent to it:
> <?xml version="1.0" encoding="UTF-8"?>
> <e:Envelope xmlns:e="http://schemas.xmlsoap.org/soap/envelope/">
>  <e:Body>
>    <ping>
>      <pingRequest>
>        <message xmlns="http://soap">hel lo</message>
>      </pingRequest>
>    </ping>
>  </e:Body>
> </e:Envelope>
>
> My servicemix.xml file is at the end of this message. I have checked 
> the service names of my endpoints many times - this example works if 
> the two service assemblies are in the same ServiceMix instance, or 
> even in two instances on the same machine. It is only if they are on 
> separate machines that there is a problem.
>
> Is there some ActiveMQ configuration option I am overlooking? Does 
> anybody have an idea as to what could be going wrong?
>
> Thanks,
> Jamie Penney
>
> servicemix.xml:
>
> <beans xmlns:sm="http://servicemix.apache.org/config/1.0"
>       xmlns:audit="http://servicemix.apache.org/audit/1.0"
>       xmlns:amq="http://activemq.org/config/1.0">
>
>    <bean id="jndi" 
> class="org.apache.xbean.spring.jndi.SpringInitialContextFactory"
>        factory-method="makeInitialContext" singleton="true" />
>
>        <!-- the JBI container -->
>    <sm:container id="jbi"
>            name="machine3"
>            flowName="jms"
>            useMBeanServer="true"
>            createMBeanServer="true"
>            createJmxConnector="true"
>            persistent="true"
>            rmiPort="1113">
>    <sm:activationSpecs>
>
>    </sm:activationSpecs>
>  </sm:container>
>
>    <!-- ActiveMQ JMS Broker configuration -->
>  <amq:broker brokerName="broker3">
>    <amq:managementContext>
>      <bean class="org.apache.activemq.broker.jmx.ManagementContext">
>        <property name="createConnector" value="false" />
>      </bean>
>    </amq:managementContext>
>
>    <!-- Use journaled JDBC persistence -->
>    <amq:persistenceAdapter>
>        <memoryPersistenceAdapter/>
>    </amq:persistenceAdapter>
>
>    <amq:transportConnectors>
>       <amq:transportConnector uri="tcp://localhost:61616" 
> discoveryUri="multicast://default"/>
>    </amq:transportConnectors>
>      <amq:networkConnectors>
>      <!-- by default just auto discover the other brokers  -->
>      <amq:networkConnector uri="multicast://default"/>
>    </amq:networkConnectors>
>
>  </amq:broker>
> </beans>