9 Replies Latest reply on Jan 3, 2008 2:05 PM by Tim Fox

    Traying to run Bridge service

    Yan Newbie

      I have 2 jboss messaging running as ha cluster.
      im trying to create a 3rd messaging server which uses a bridge in order to get
      the queue used by the cluster . following the doc/examples/bridge i copy the test-bridge and set a new provider
      create a queue to match the cluster queue

      here is my setting :

      <mbean code="org.jboss.jms.jndi.JMSProviderLoader"
       name="jboss.messaging:service=JMSProviderLoader,name=RemoteJMSProvider">
       <attribute name="ProviderName">RemoteJMSProvider</attribute>
       <attribute name="ProviderAdapterClass">
       org.jboss.jms.jndi.JNDIProviderAdapter
       </attribute>
       <attribute name="FactoryRef">java:/XAConnectionFactory</attribute>
       <attribute name="QueueFactoryRef">java:/XAConnectionFactory</attribute>
       <attribute name="TopicFactoryRef">java:/XAConnectionFactory</attribute>
       <attribute name="Properties">
       java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
       java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces
       java.naming.provider.url=192.168.10.10:1100
       java.naming.provider.url=192.168.10.11:1100
       </attribute>
       </mbean>


      <?xml version="1.0" encoding="UTF-8"?>
      <server>
       <mbean code="org.jboss.jms.server.bridge.BridgeService"
       name="jboss.messaging:service=Bridge,name=TestBridge"
       xmbean-dd="xmdesc/Bridge-xmbean.xml">
       <depends optional-attribute-name="TargetProviderLoader">jboss.messaging:service=JMSProviderLoader,name=JMSProvider</depends>
       <depends optional-attribute-name="SourceProviderLoader">jboss.messaging:service=JMSProviderLoader,name=RemoteJMSProvider</depends>
       <attribute name="SourceDestinationLookup">/queue/etSubscribtionQueue</attribute>
       <attribute name="TargetDestinationLookup">/queue/etSubscribtionQueue</attribute>
       <attribute name="QualityOfServiceMode">0</attribute>
       <attribute name="MaxBatchSize">5</attribute>
       <attribute name="MaxBatchTime">-1</attribute>
       <attribute name="FailureRetryInterval">5000</attribute>
       <attribute name="MaxRetries">-1</attribute>
       <attribute name="AddMessageIDInHeader">false</attribute>
       </mbean>
       </server>


      when i deploy the new setting i get no errors nor warning, but something is not working
      i see that packets flow from the bridge to the cluster and back but they stop after ( looks like a begining of a connection )
      then it waits a while and start again , am i doing something wrong here ?

      Thanks


        • 1. Re: Traying to run Bridge service
          Tim Fox Master

          Any JNDI url that begins with "java:" is only available in the *same virtual machine*.

          You clearly want to look up objects from JNDI from different machines, so looking them up from your in vm context is not going going to be correct.

          • 2. Re: Traying to run Bridge service
            Yan Newbie

            Thanks timfox for your prompt response.

            now we facing different problem.

            it looks like we are connected to the remote server, but don't get data from it.

            do we need to define the bridge in the remote server also ?

            the remote server has jboss service that create those messages and send them to any client that subscribe to it.

            how do we set the bridge, in that way that it will be only pipe of data.

            no logic needed just get the jms from the remote server and send it to the servers that subscribe to it.

            Thanks,

            yyagol

            • 3. Re: Traying to run Bridge service
              Tim Fox Master

              There is an example of this on the user wiki.

              • 4. Re: Traying to run Bridge service
                J A Newbie

                Hi,

                I also have a little problem with starting the Message Brdige service...

                According to the official guide, i had made my remote JMSProvider mbean in jms-ds.xml, and deployed my bridge-service.xml. Aftrer that i got the following exception:

                javax.naming.CommunicationException [Root exception is java.rmi.NoSuchObjectException: no such object in table]
                 at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:780)
                 at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:627)
                 at javax.naming.InitialContext.lookup(Unknown Source)
                 at org.jboss.jms.server.bridge.JNDIFactorySupport.createObject(JNDIFactorySupport.java:66)
                 at org.jboss.jms.server.bridge.JNDIDestinationFactory.createDestination(JNDIDestinationFactory.java:45)
                 at org.jboss.jms.server.bridge.Bridge.setupJMSObjects(Bridge.java:910)
                 at org.jboss.jms.server.bridge.Bridge.setupJMSObjectsWithRetry(Bridge.java:1152)
                 at org.jboss.jms.server.bridge.Bridge.access$1500(Bridge.java:66)
                 at org.jboss.jms.server.bridge.Bridge$FailureHandler.run(Bridge.java:1507)
                 at java.lang.Thread.run(Unknown Source)
                Caused by: java.rmi.NoSuchObjectException: no such object in table
                 at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(Unknown Source)
                 at sun.rmi.transport.StreamRemoteCall.executeCall(Unknown Source)
                 at sun.rmi.server.UnicastRef.invoke(Unknown Source)
                 at org.jnp.server.NamingServer_Stub.lookup(Unknown Source)
                 at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:675)
                 ... 9 more
                
                


                What could be the reason of this, and how should i fix it?


                Thx for the answer in advance.

                JA

                • 5. Re: Traying to run Bridge service
                  Tim Fox Master

                  Please read the FAQ!

                  • 6. Re: Traying to run Bridge service
                    J A Newbie

                    After I had managed to start the Message Bridge, I noticed an interesting thing.

                    The source queue of my bridge didn't show the amount of the sended messages. In other words: it looks like the messages sended into the source queue never goes into the source queue, and they go immediately to the destination queue via the bridge.

                    Therefore I can't recognize at the source side of the bridge that my messaging flow is working correctly.

                    Is this a normal functioning of Message Bridge?

                    • 7. Re: Traying to run Bridge service
                      Tim Fox Master

                       

                      "JA121" wrote:
                      After I had managed to start the Message Bridge, I noticed an interesting thing.

                      The source queue of my bridge didn't show the amount of the sended messages.


                      What attribute of the source queue are you looking at? Message Count?

                      If so, then yes, this may well show zero, since the messages are no longer in the source queue - they have been moved to the destination.

                      • 8. Re: Traying to run Bridge service
                        J A Newbie

                         

                        "timfox" wrote:
                        "JA121" wrote:
                        After I had managed to start the Message Bridge, I noticed an interesting thing.

                        The source queue of my bridge didn't show the amount of the sended messages.


                        What attribute of the source queue are you looking at? Message Count?

                        If so, then yes, this may well show zero, since the messages are no longer in the source queue - they have been moved to the destination.


                        Yes, the MessageCount is zero, but it's not too astonishing.

                        There are two other attribute related in number of messages:

                        MessageCounter and MessageStatistics.

                        None of them are changed when I using a Message Bridge, however I guessed they display the traffic of the queue. In case of Message Bridge only the DeliveringCount attribute is incrased.



                        • 9. Re: Traying to run Bridge service
                          Tim Fox Master

                          If you want to use message counters you need to explicitly enable them.

                          See userguide for more details.