OK
I ma actually responding to my own question so one might benefit in the
future.
Finally I got the time to look at the source and realize what my problem
was.
Just to recap the issue:
I could not establish SM cluster when Security Broker configuration in
the servicemix.xml file was present.
JMSFlow creates connection from JMS URL if it is specified by the
following tag in your Secured Broker configuration:
<sm:jmsFlow jmsURL="${activemq.url}" />
Which in my case was tcp://localhost:11161
And here is the line of code that does it (JMSFlow.java):
return (jmsURL != null) ? new PooledConnectionFactory(jmsURL) : new
PooledConnectionFactory();
If URL is not specified, then URL will default to peer transport:
So the issue is about two transports: TCP and PEER
Reading ActiveMQ documentation I don't see any place where TCP transport
will establish a communication with other brokers. However there is a
PEER transport which does establish communication with other peers
available.
http://activemq.apache.org/peer-transport-reference.html
So, by changing URL to peer://ozman?persistent=false, I've connected two
nodes using Secured Broker.
Cheers
-----Original Message-----
From: Zhurakousky, Oleg [mailto:[EMAIL PROTECTED]
Sent: Friday, September 21, 2007 8:57 AM
To: [email protected]
Subject: RE: ServiceMix Cluster
Bruce
The distribution I am actually using is the latest FUSE which I believe
would be 3.1 of Service Mix and also let's forget about the Cluster
example for now since I don't really have any problem running it. I also
realized you don't need an example to see the cluster working, since
there is plenty in the logs to verify that. So. . .
When I exclude the Security Broker definition from my
servicemix-node1.xml (and node2 respectively) file, my last line in the
log when I start the first Node shows:
//
INFO - JBIContainer - ServiceMix JBI Container
(node1) started
//
Then I start the second Node and what I see is that Demand Forwarding
bridge has been established between the two nodes. Here is a fragment
from my log:
//
INFO - NetworkConnector - Establishing network connection
between from vm://peer--2344-1190377993829-3-0?
network=true to tcp://ustr-zhurako2:2354
DEBUG - WireFormatNegotiator - Sending: WireFormatInfo {
version=2, properties={TightEncodingEnabled=true, Cac
heSize=1024, TcpNoDelayEnabled=true, SizePrefixDisabled=false,
StackTraceEnabled=true, MaxInactivityDuration=30000, Cach
eEnabled=true}, magic=[A,c,t,i,v,e,M,Q]}
DEBUG - WireFormatNegotiator - Received WireFormat:
WireFormatInfo { version=2, properties={TightEncodingEnabl
ed=true, CacheSize=1024, TcpNoDelayEnabled=true,
SizePrefixDisabled=false, StackTraceEnabled=true, MaxInactivityDuration
=30000, CacheEnabled=true}, magic=[A,c,t,i,v,e,M,Q]}
DEBUG - WireFormatNegotiator - tcp://localhost/127.0.0.1:2354
before negotiation: OpenWireFormat{version=2, ca
cheEnabled=false, stackTraceEnabled=false, tightEncodingEnabled=false,
sizePrefixDisabled=false}
DEBUG - WireFormatNegotiator - tcp://localhost/127.0.0.1:2354
after negotiation: OpenWireFormat{version=2, cac
heEnabled=true, stackTraceEnabled=true, tightEncodingEnabled=true,
sizePrefixDisabled=false}
DEBUG - TransportConnection - Setting up new connection:
[EMAIL PROTECTED]
7d
INFO - DemandForwardingBridge - Network connection between
vm://peer--2344-1190377993829-3-0#2 and tcp://localh
ost/127.0.0.1:2354(peer--2352-1190378017751-3-0) has been established.
DEBUG - AbstractRegion - Adding consumer:
ID:ustr-zhurako2-2344-1190377993829-6:1:1:2
DEBUG - AbstractRegion - Adding destination:
queue://org.apache.servicemix.jms.node2
DEBUG - AbstractRegion - Adding destination:
topic://ActiveMQ.Advisory.Consumer.Queue.org.apache.service
mix.jms.node2
//
I do not see any errors or any of the messages you see above in my logs
if Security Broker is defined.
So, without Security Broker, when I deploy my sample services (not the
example) it all works as expected, so essentially I don't have problem
with setting up a cluster and if it was not for that XML segment I think
I would be OK, but it just bugs me when I don't understand why it is not
working when Security Broker configuration is defined.
I am also attaching servicemix-node1.xml
Thanks
Oleg
-----Original Message-----
From: Bruce Snyder [mailto:[EMAIL PROTECTED]
Sent: Friday, September 21, 2007 1:16 AM
To: [email protected]
Subject: Re: ServiceMix Cluster
On 9/20/07, Zhurakousky, Oleg <[EMAIL PROTECTED]> wrote:
> Guys
>
>
>
> I was just trying to extend clustering example that comes with
> distribution to run inside of main ServiceMix configuration (as
> conf/servicemix.xml). Obviously it didn't work, so I went through
> process of elimination or actually "build-up" by taking
> servicemix-poller.xml and moving components from servicemix.xml into
it
> and. got it to work. I also realized what was stopping it from working
> when I did it the first time, but I am not sure why. The issue was
with
> the Secured Broker configuration (see below) that apparently does not
> let two nodes join into the cluster. Once this XML segment removed I
see
> tow nodes joining in the cluster.
>
>
>
> ====
>
> <!-- Use a secured broker (see security.xml)
>
> and define the 3 standard flows -->
>
> <sm:broker>
>
> <sm:securedBroker authorizationMap="#authorizationMap">
>
> <sm:flows>
>
> <sm:sedaFlow />
>
> <sm:jmsFlow jmsURL="${activemq.url}" />
>
> <sm:jcaFlow connectionManager="#connectionManager"
>
> jmsURL="${activemq.url}" />
>
> </sm:flows>
>
> </sm:securedBroker>
>
> </sm:broker>
>
> ====
>
>
>
> I'll be looking at the source tomorrow, but would appreciate if anyone
> could point me in the right direction as to Why Secure Broker
> configuration
What version of ServiceMix are you using? To what clustering example
are you referring, possibly the old one? Did you see any errors? If so
please post them.
Bruce
--
perl -e 'print
unpack("u30","D0G)[EMAIL PROTECTED]&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/
Castor - http://castor.org/