7 Replies Latest reply on Sep 11, 2009 1:55 AM by davsclaus

    MSMQ Component and character encoding

    hubert.pacros

      I currently have a standalone JMS to MSMQ gateway using the MSMQ component provided with Fuse Mediation Router.

       

      In the MSMQ Queue, characters coming from the JMS TextMessage are encoded with 2 bytes and cause an error when the .Net application read them (characters coming from the .Net application are encoded with 1 byte).

       

      Is there a way to configure the MSMQ component to achieve interoperability ?

        • 1. Re: MSMQ Component and character encoding
          gseben

          Currently, the producer code for the MSMQ componenet uses a two-byte encoding since the native encoding for a char in java is UTF-8. I'm guessing that your .NET application is not using the same encoding as java. Changing the .NET application to use UTF-8 strings will likely solve this problem.

          • 2. Re: MSMQ Component and character encoding
            arun.addepalli

            In all the forums i searched, your's is the first post which says installed "JMS to MSMQ gateway". How did you do that?

             

            I tried the following but not working:

             

            Problem statement: Want to create a forward bridge from standalone ActiveMQ on Solaris to MSMQ on windows box. Post the messages to AMQ and let clients read the messages from MSMQ.

             

            Platform: Solaris 10 / JDK "1.5.0_15"

             

            What i tried so far:

            1. Installed the Fuse message router(as per documentation) and copied the apache-camel-1.6.1.2-fuse.jar to AMQ's lib directory.

            2. in activemq.xml, under camelContext added the below lines:

             

            -


                     

                        <to uri="msmq::remoteServer:1801
            private$
            ActiveMQTest?deliveryPersistent=true"/>

                    </route>

            -


            3. when AMQ broker is re-started, seeing the following error messages in the AMQ log & broker EXITS:

             

            -


            INFO  CamelNamespaceHandler          - camel-osgi.jar not detected in classpath

            INFO  DefaultCamelContext            - Apache Camel  (CamelContext:camel) is starting

            Failed to execute main task. Reason: java.lang.UnsatisfiedLinkError: no msmq_native_support in java.library.path

            -


             

            First of all, is my approach correct?

            Are steps 1 & 2 in line to solve the problem statement?

            How to resolve this issue and make the AMQ-MSMQ bridge work?

             

            Please help!!

            • 3. Re: MSMQ Component and character encoding
              njiang

              The MSMQ component only works for Windows platform. The component will call the native MSMQ's dll when it talks to MSMQ.

              • 4. Re: MSMQ Component and character encoding
                arun.addepalli

                So, Is there a any way to configure One way Forward bridge from ActiveMQ 5.20(Solaris/Linux) to MSMQ (windows)? We want this for our prototype.

                 

                If yes, please provide some details.

                 

                Thanks in Advance!

                • 5. Re: MSMQ Component and character encoding
                  njiang

                  Hi,

                   

                  You can setup bridge in a windows box which consumes the message from ActiveMQ which is hosted in a (Solaris/Linux) box, and forwards the message into MSMQ.

                   

                  Cheers,

                   

                  Willem

                  • 6. Re: MSMQ Component and character encoding
                    arun.addepalli

                    what if the MSMQ is on the billing system which is not under our control?

                     

                    The requirement is ... we have to post or forward the messages from our AMQ(under our control) to the MSMQ of the billing systems(not under our control)

                     

                    How can we achieve this?

                    • 7. Re: MSMQ Component and character encoding
                      davsclaus

                      You may need another adapter that is capable of using pure Java to send to a remote MSMQ broker.

                       

                      Sonic have a list of adapters at:

                      http://www.sonicsoftware.com/products/sonic_esb/adapters_sonic_esb/adapter_list/index.ssp

                       

                      And I believe it should be possible to leverage such a driver.