Still problems with failover and amq. I continued with my testing using explicit declaration of flows in <sm:flows> element -- this works around the propblem with parsing the flowName attribute.

The jmsflow starts up fine with a failover urls like:

failover://(tcp://localhost:61617,tcp://localhost:61618)? randomize=false

I can send a receive exchanges fine at this point.

I then kill the master broker - I can see from the logs that the slave is opening its transports and ready to receive messages, but at this point my servicemix app stops working.

Messages are introduced into my app in two ways, either by a quartz timer using 'QuartzComponent' or via a 'JMSInUsingJCA' binding. in the jms case, the broker factory is configured with the failover uri above as well.

No matter which, any attempt to send an exchange results in:

javax.jms.JMSException: Cannot send from a session that had not been registered: ID:

I can see in the log when I killed the master, but I do not see any further attempts to reconnect, the slave is never connected to.

http-localhost%2F127.0.0.1-8083-Processor25 2006-12-11 16:39:42,017 DEBUG [FailoverTransport:stop] Stopped. ActiveMQ Transport: tcp://localhost/127.0.0.1:61618 2006-12-11 16:39:42,054 DEBUG [FailoverTransport:handleTransportFailure] Transport failed, starting up reconnect task
java.net.SocketException: Socket closed
        at java.net.SocketInputStream.socketRead0(Native Method)
        at java.net.SocketInputStream.read(SocketInputStream.java:129)
at org.apache.activemq.transport.tcp.TcpBufferedInputStream.fill (TcpBufferedInputStream.java:48) at org.apache.activemq.transport.tcp.TcpBufferedInputStream.read (TcpBufferedInputStream.java:55)
        at java.io.DataInputStream.readInt(DataInputStream.java:353)
at org.apache.activemq.openwire.OpenWireFormat.unmarshal (OpenWireFormat.java:274) at org.apache.activemq.transport.tcp.TcpTransport.run (TcpTransport.java:126)
        at java.lang.Thread.run(Thread.java:613)



JMSInUsingJCA:
<sm:activationSpec componentName="jmsRequestInBinding" service="cm:jms-request-in-binding"
                           destinationService="cm:request-processor">
                <sm:component>
<bean class="org.apache.servicemix.components.jms.JmsInUsingJCABinding">
                        <property name="jcaContainer" ref="jencks"/>
                        <property name="activationSpec">
<bean class="org.apache.activemq.ra.ActiveMQActivationSpec"> <!-- The variable (receiver.in.topic) is replaced at runtime using the PropertyPlaceholderConfigurer defined in this config file --> <property name="destination" value="$ {smix.request.in.topic}"/> <property name="destinationType" value="javax.jms.Topic"/>
                            </bean>
                        </property>
                    </bean>
                </sm:component>
            </sm:activationSpec>


Jencks:
    <bean id="jencks" class="org.jencks.JCAContainer" singleton="true">
<!-- lets use the default configuration of work manager and transaction manager-->
        <property name="bootstrapContext">
            <bean
                class="org.jencks.factory.BootstrapContextFactoryBean">
                <property name="threadPoolSize" value="25" />
            </bean>
        </property>
        <!-- the JCA Resource Adapter -->
        <property name="resourceAdapter">
            <bean id="activeMQResourceAdapter"
                class="org.apache.activemq.ra.ActiveMQResourceAdapter"
                singleton="true">
                <property name="serverUrl"
                    value="${smix.amq.broker.uri}" />
            </bean>
        </property>
    </bean>


At this point, I'm in over my head - any advice is most welcome,

Thanks,

BJ

On Dec 11, 2006, at 2:42 PM, Guillaume Nodet wrote:

I think the problem may actually come from servicemix,
which does not correctly parse the url and split it
without taking care of parenthesis.
You may want to hack the o.a.s.jbi.nmr.DefaultBroker#init
method and provide a patch for that ?

On 12/11/06, William Blackburn <[EMAIL PROTECTED]> wrote:
I can't explain why - but now it seems to be working as expected -
and the log confirms it. Now I have a new issue that came up while
working on this one - specifically, the url:

        jms?jmsURL=failover://(tcp://localhost:61616)

Behaves as expected, but if I attempt to include another broker, as in:

         jms?jmsURL=failover://(tcp://localhost:61616, tcp://
localhost:61617)?randomize=false

JMS Flow fails to initialize with:

Failed to initialize JMSFlow
javax.jms.JMSException: Could not connect to broker URL: failover://
(tcp://localhost:61616. Reason: java.io.IOException: Invalid
location: failover://(tcp://localhost:61616

If the message is any indication, the url appears to be being split
at the comma - I've tried several forms of the url, the amq docs seem
to alternate between failover: and failover:// -- but always the same
result. The upshot is, I can't seem to get servicemix working with
master/slave brokers. I'm sorry - it occurs to me this may well be an
AMQ issue - but if you've ever seen anything like this, please let me
know.

BJ


Full stack trace is:

main 2006-12-11 13:01:24,137 ERROR [JMSFlow:init] Failed to
initialize JMSFlow
javax.jms.JMSException: Could not connect to broker URL: failover://
(tcp://localhost:61616. Reason: java.io.IOException: Invalid
location: failover://(tcp://localhost:61616
         at org.apache.activemq.util.JMSExceptionSupport.create
(JMSExceptionSupport.java:32)
         at
org.apache.activemq.ActiveMQConnectionFactory.createActiveMQConnectio n
(ActiveMQConnectionFactory.java:252)
         at
org.apache.activemq.ActiveMQConnectionFactory.createActiveMQConnectio n
(ActiveMQConnectionFactory.java:211)
         at
org.apache.activemq.ActiveMQConnectionFactory.createConnection
(ActiveMQConnectionFactory.java:158)
         at org.apache.servicemix.jbi.nmr.flow.jms.JMSFlow.init
(JMSFlow.java:245)
         at org.apache.servicemix.jbi.nmr.DefaultBroker.init
(DefaultBroker.java:135)
         at org.apache.servicemix.jbi.container.JBIContainer.init
(JBIContainer.java:556)
         at
org.apache.servicemix.jbi.container.SpringJBIContainer.afterPropertie sSe
t(SpringJBIContainer.java:55)
         at
org.springframework.beans.factory.support.AbstractAutowireCapableBean Fac
tory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:957)
         at
org.springframework.beans.factory.support.AbstractAutowireCapableBean Fac
tory.initializeBean(AbstractAutowireCapableBeanFactory.java:924)
         at
org.springframework.beans.factory.support.AbstractAutowireCapableBean Fac
tory.createBean(AbstractAutowireCapableBeanFactory.java:415)
         at
org.springframework.beans.factory.support.AbstractBeanFactory
$1.getObject(AbstractBeanFactory.java:242)
         at
org.springframework.beans.factory.support.DefaultSingletonBeanRegistr y.g
etSingleton(DefaultSingletonBeanRegistry.java:141)
         at
org.springframework.beans.factory.support.AbstractBeanFactory.getBean
(AbstractBeanFactory.java:239)
         at
org.springframework.beans.factory.support.AbstractBeanFactory.getBean
(AbstractBeanFactory.java:155)
         at
org.springframework.beans.factory.support.DefaultListableBeanFactory. pre
InstantiateSingletons(DefaultListableBeanFactory.java:303)
         at
org.springframework.context.support.AbstractApplicationContext.refres h
(AbstractApplicationContext.java:348)
         at
org.springframework.web.context.support.AbstractRefreshableWebApplica tio
nContext.refresh(AbstractRefreshableWebApplicationContext.java:156)
         at
org.springframework.web.context.ContextLoader.createWebApplicationCon tex
t(ContextLoader.java:246)
         at
org.springframework.web.context.ContextLoader.initWebApplicationConte xt(
ContextLoader.java:184)
         at
org.springframework.web.context.ContextLoaderListener.contextInitiali zed
(ContextLoaderListener.java:49)
         at org.apache.catalina.core.StandardContext.listenerStart
(StandardContext.java:3763)
         at org.apache.catalina.core.StandardContext.start
(StandardContext.java:4211)
         at org.apache.catalina.core.ContainerBase.addChildInternal
(ContainerBase.java:759)
         at org.apache.catalina.core.ContainerBase.addChild
(ContainerBase.java:739)
         at org.apache.catalina.core.StandardHost.addChild
(StandardHost.java:524)
         at org.apache.catalina.startup.HostConfig.deployDirectory
(HostConfig.java:904)
         at org.apache.catalina.startup.HostConfig.deployDirectories
(HostConfig.java:867)
         at org.apache.catalina.startup.HostConfig.deployApps
(HostConfig.java:474)
         at org.apache.catalina.startup.HostConfig.start
(HostConfig.java:1122)
         at org.apache.catalina.startup.HostConfig.lifecycleEvent
(HostConfig.java:310)
         at
org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent
(LifecycleSupport.java:119)
         at org.apache.catalina.core.ContainerBase.start
(ContainerBase.java:1021)
         at org.apache.catalina.core.StandardHost.start
(StandardHost.java:718)
         at org.apache.catalina.core.ContainerBase.start
(ContainerBase.java:1013)
         at org.apache.catalina.core.StandardEngine.start
(StandardEngine.java:442)
         at org.apache.catalina.core.StandardService.start
(StandardService.java:450)
         at org.apache.catalina.core.StandardServer.start
(StandardServer.java:709)
         at org.apache.catalina.startup.Catalina.start(Catalina.java:
551)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke
(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke
(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:585)
         at org.apache.catalina.startup.Bootstrap.start
(Bootstrap.java:294)
at org.apache.catalina.startup.Bootstrap.main (Bootstrap.java:
432)
Caused by: java.io.IOException: Invalid location: failover://(tcp://
localhost:61616
         at
org.apache.activemq.transport.failover.FailoverTransportFactory.doCon nec
t(FailoverTransportFactory.java:42)
         at org.apache.activemq.transport.TransportFactory.doConnect
(TransportFactory.java:42)
         at org.apache.activemq.transport.TransportFactory.connect
(TransportFactory.java:76)
         at
org.apache.activemq.ActiveMQConnectionFactory.createActiveMQConnectio n
(ActiveMQConnectionFactory.java:223)
         ... 43 more



On Dec 11, 2006, at 12:57 PM, Guillaume Nodet wrote:

> Could you set the org.apache.activemq log level to DEBUG
> in ServiceMix and check if there is an attempt to reconnect ?
>
> On 12/11/06, William Blackburn <[EMAIL PROTECTED]> wrote:
>> I was reading in the Amq docs about clients that can survive short
>> broker outages by connecting using failover transport, even though
>> there was really only one broker.
>>
>> I thought this behavior was ideal for my servicemix app using jms
>> flow, so I set up an external broker, ran it, and setup servicemix to
>> use:
>>
>>         jms?jmsURL=failover:tcp://localhost:61616
>>
>> I also tried:
>>
>>         jms?jmsURL=failover://(tcp://localhost:61616)
>>
>> In each case, everything worked fine after the initial startup, but >> after restarting the broker, servicemix did not recover and had to be
>> restarted too. Is this behavior not supported, or have I missed
>> something in configuration?
>>
>> Thanks,
>>
>> BJ
>>
>
>
> --
> Cheers,
> Guillaume Nodet




--
Cheers,
Guillaume Nodet

Reply via email to