JBOSS messaging and stompConnect

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

JBOSS messaging and stompConnect

NewWay
Hello all,

I'm trying to create a C++ client for JBOSS messaging using stompConnect.

I'm using:

  • JBOSS 4.2.3.GA
  • JBOSS-messaging-1.4.2.GA-SP1
  • stompConnect-1.0
  • activemq-cpp-library-3.0

  • in the activemq I'm trying to run the example program, where the only thing I did was to set the brokerURI to
    "tcp://127.0.0.1:61613"
    "?wireFormat=stomp"

    I used the script from the stomp site to set up stomp with JBOSS

    And here is my problem
    I keep getting from the JBOSS side an exception saying that User is NOT authenticated

    I noticed that in the message, between user and is there are two spaces and not one, which means that the user parameter arrives empty

    Did I miss something out in the connection chain?
    isn't the user name taken from the property -Djava.naming.security.principal

    You're help would be greatly appreciated.
    Reply | Threaded
    Open this post in threaded view
    |

    Re: JBOSS messaging and stompConnect

    NewWay
    I got it working 
    what I needed to do is in the cpp code to add the user and password.

    But still, i don't understand the purpose of those lines in the script

    rem set properties=%properties% -Djava.naming.security.principal=guest
    rem set properties=%properties% -Djava.naming.security.credentials=guest
    Reply | Threaded
    Open this post in threaded view
    |

    Re: JBOSS messaging and stompConnect

    Alexander L.
    Hello NewWay,

    Could you share you success a little bit more please?
    I am trying to make the same - receive messages on JBoss side (messages sent from C++ client).
    I am also confused about these settings: -Djava.naming.security.principal=guest and -Djava.naming.security.credentials=guest.
    But main thing I want to know is what should be the name of topic/queue on JBoss?
    And what user and password have you added in cpp code?

    NewWay wrote
    I got it working 
    what I needed to do is in the cpp code to add the user and password.

    But still, i don't understand the purpose of those lines in the script

    rem set properties=%properties% -Djava.naming.security.principal=guest
    rem set properties=%properties% -Djava.naming.security.credentials=guest
    Reply | Threaded
    Open this post in threaded view
    |

    Re: JBOSS messaging and stompConnect

    NewWay
    Hi,

    Alexander L. wrote
    I am also confused about these settings: -Djava.naming.security.principal=guest and -Djava.naming.security.credentials=guest.
    I'm still confused here - no progress was done

    Alexander L. wrote
    But main thing I want to know is what should be the name of topic/queue on JBoss?
    And what user and password have you added in cpp code?
    the topic/queue in JBOSS should be the one you sent to in the C++, if you'll notice in the main.cpp in the vs2005-activemq-example there is the HelloWorldConsumer and in the run method  you can see the line destination = session->createQueue( "TEST.FOO" ); change "TEST.FOO" to be the queue name in JBOSS.

    now about the change in the code, i assumed that it will use the
    Alexander L. wrote
    -Djava.naming.security.principal=guest and -Djava.naming.security.credentials=guest.
    but it didn't, so what i did was to change the code of ActiveMQConnectionFactory so the constructor  with this signature looks like this.

    cms::ConnectionFactory* cms::ConnectionFactory::createCMSConnectionFactory( const std::string& brokerURI )
        throw ( cms::CMSException ) {

        return new ActiveMQConnectionFactory( brokerURI , "guest", "guest");
    }


    my addition is in bold.

    hope this helps you get a start