1 2 Previous Next 20 Replies Latest reply on Jan 19, 2006 11:28 AM by jboss2005_01 Go to original post
      • 15. Re: non-java clients

        Thanks for the notice. The testing, especially the load testing, are very exciting. Have you considered stress testing with simulated networking problems? I've been using a machine running nistNet (http://snad.ncsl.nist.gov/itg/nistnet/) recently to test our network protocols under varying network problem-conditions. We started this testing because in our production csil/jbossmq3.2 configuration, every once in a long while a client will be disconnected from the server by a network failure, but the server doesn't seem to notice. So messages pile up in the topics awaiting delivery, and eventually bad things happen.

        I've looked over the remoting pages, and now I am wondering -- what would be involved in writing a c# client to the jboss remoting? If we had something like that, what services would be available to c# clients from jboss? What about other client languages? Maybe I should be asking this on the remoting forum...

        • 16. Re: non-java clients
          jboss2005_01

          Nice initiative, really !!! Exactly the thing I've been looking for quite some time now. I just downloaded and installed the CsIL code and tried to use it in a sample application. Installation is a piece of cake, but what I was wondering. Does anyone have a basic .NET application explaining briefly what steps need to be taken to get a working sample. Any information about this item would be really nice.

          Greets,
          Kurt

          • 17. Re: non-java clients

            Hi,

            I'm glad you like xil2.

            First you need to create a connection. The connection uses a factory pattern, so you create a configuration object, and pass it to the factory. JBMQ authenticates connections, so you also need to pass in a username/password via an AuthenticationRequest.

            In code:

             ConnectionFactory cf = new ConnectionFactory();
             cf.Config.ServerAddress = yourAddressString;
             cf.Config.Port = yourPortNumber;
             cf.Config.PingPeriod = timeInMilleseconds; //default is 60 seconds
             AuthenticationRequest auth = new AuthenticationRequest(unameString,pwordString);
             conn = cf.CreateConnection(auth);
             conn.Start(); //tell the server you are ready to send/receive
            


            Next you need to create a session, a topic or queue, and a subscriber:
            yourSession = new Session(Connection, AcknowledgementTypes.AUTO_ACKNOWLEDGE);
            
            //name needs to be configured on server
            Topic t = Connection.CreateTopic(topicName);
            
            //create your subscriber. params are topic, selector string, and boolean to
            //accept locally generated messages.
            ITopicSubscriber yourSubscriber = Session.CreateSubscriber((ITopic)t,selectorString,false);
            
            //wire up an event to receive messages
            yourSubscriber.Listen += new OnMessageEventHandler(HandleMessageUpdate);
            
            //create a topic publisher, to which you can send messages
            ITopicPublisher yourPub = Session.CreatePublisher((ITopic) t);
            
            


            To subscribe to the updates you create an OnMessageEventHandler, and wrap a method with a signature like:
            public void HandleMessageUpdate(object pCaller, OnMessageEventArgs pArgs)
            {
            }



            JBMQWin is a simple client application that was written for xil, and not yet ported to xil2. However the code is still in the sourceforge repository here:
            http://cvs.sourceforge.net/viewcvs.py/csil/tamale_csxil/JBMQwin/JBMQwin.cs?rev=1.15&view=markup

            JBMQWin is in bad need of maintenance. If you modify it to work with xil2, I will happily add it to cvs.

            thanks,
            fawce


            • 18. Re: non-java clients
              jboss2005_01

              Hi,

              Great that you responded in such a fast way. It would be nice if everybody answered that fast on different forums :-). I tried the code you provided as an example but I must do something wrong since I'm getting strange error messages from .NET. I provided the stacktrace together with my example below. Any suggestion what I am doing wrong? I followed the installation instruction provided with the installation and tried using a clean JBoss install. I am using Visual Studio .NET 2003 (.NET 1.1 thus) and JBoss 4.0.2 bound to JDK 1.5.0_04. In your documents you reffer to the commons-codec-1.2.jar and castor-0.9.9-wml.jar. Do I have to install these libraries too perhaps? If so, where do I have to place them? Below jboss/server/lib?

              Stacktrace:

              Value cannot be null.
              Parameter name: type
               at System.Activator.CreateInstance(Type type, Boolean nonPublic)
               at System.Activator.CreateInstance(Type type)
               at tamalesoftware.messaging.ConnectionFactory.CreateServerIL()
               at tamalesoftware.messaging.Connection..ctor(AuthenticationRequest pAuth, ConnectionFactory pFactory)
               at tamalesoftware.messaging.ConnectionFactory.CreateConnection(Authentication
              Request pAuth)
               at tamalesoftware.messaging.ConnectionFactory.CreateConnection()
               at JMSTest.JMSTest..ctor() in d:\visual studio projects\jmstest\jmstest\jmstest.cs:line 19
              


              C# code:
              using System;
              using tamalesoftware.messaging;
              using tamalesoftware.jms;
              using tamalesoftware.concurrent;
              
              namespace JMSTest
              {
               class JMSTest
               {
               public JMSTest()
               {
               try
               {
               ConnectionFactory factory = new ConnectionFactory();
               factory.Config.ServerAddress = "192.168.3.120";
               factory.Config.Port = 8094;
               factory.Config.PingPeriod = 10;
               AuthenticationRequest auth = new AuthenticationRequest("admin", "admin");
               Connection conn = factory.CreateConnection();
               conn.Start();
              
               Session session = new Session(conn, AcknowledgementTypes.AUTO_ACKNOWLEDGE);
               Topic topic = conn.CreateTopic("topic/SMCTopic");
               ITopicSubscriber subscribe = session.CreateSubscriber((ITopic)topic);
               subscribe.Listen += new OnMessageEventHandler(doEvent);
               ITopicPublisher publish = session.CreatePublisher((ITopic)topic);
               TextMessage message = new TextMessage();
               message.Text = "Dit is een test.";
               publish.Send(message);
              
               }
               catch(Exception ex)
               {
               Console.WriteLine(ex.Message);
               Console.WriteLine(ex.StackTrace);
               }
              
               Console.ReadLine();
               }
              
               public void doEvent(object sender, OnMessageEventArgs args)
               {
               Console.WriteLine("--> " + args.Message);
               }
              
              
               [STAThread]
               static void Main(string[] args)
               {
               new JMSTest();
               }
               }
              }
              


              I asume that the user and password required for authentication is a password assigned to the JMS systems.

              Again, any advise would be appreciated and thanks again for your fast response.

              Greetings,
              Kurt

              • 19. Re: non-java clients

                Can we please move this "how do I use it" HIJACK
                to a thread in the user forums.

                Thank you.

                • 20. Re: non-java clients
                  jboss2005_01

                  Hello,


                  The discussion had been moved to the user forum found at:
                  http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3918451#3918451


                  Greetings,
                  Kurt

                  1 2 Previous Next