• 1 reply
  • Latest Post - ‏2012-09-18T13:18:53Z by SystemAdmin
1250 Posts

Pinned topic JBoss JMS Connection

‏2012-09-18T05:41:14Z |
Can someone help me to configure CastIron studio so that I can connect to JBoss via JMS. I don’t know what libraries to import into the studio and how to configure the JMS Endpoint.

Updated on 2012-09-18T13:18:53Z at 2012-09-18T13:18:53Z by SystemAdmin
  • SystemAdmin
    1250 Posts

    Re: JBoss JMS Connection

    Hi, after a few hours of reading I have made some steps with this subject:

    I’m using: jboss-as-7.1.1.Final
    I have imported the “\jboss-as-7.1.1.Final\bin\client\jboss-client.jar” as a JMS module provider for the CI Studio (JBoss uses HornetQ as a JMS Implementation)
    I have defined a JMS endpoint like this:

    JNDI Initial Factory: “org.jboss.naming.remote.client.InitialContextFactory”
    Provider URL: “remote://” (where is the JBoss server ip address)
    Provider Package: -blanck-
    Factory Name: “/jms/RemoteConnectionFactory”
    Provider username: “jmsuser”
    Provider Password: “jmspassw0rd”
    The “Test Connection” is successful, but when I open an orchestration, the CI Studio is telling me that “Factory Name does not have proper format.”

    I have written a small java program to test these settings and they work fine from the Eclipse JEE Studio. Does anyone know how to bypass the Factory Name format check?
    Below is the java code:
    public class TopicConsumer implements MessageListener {

    public void onMessage(Message message) {
    try {
    System.out.println(((TextMessage) message).getText());
    } catch (JMSException e) {


    * @param args
    * @throws NamingException
    * @throws JMSException
    public static void main(String[] args) throws NamingException, JMSException {
    System.out.println("----- Entering Main for TopicConsumer -----");
    Context context = TopicConsumer.getInitialContext();
    TopicConnectionFactory topicConnectionFactory = (TopicConnectionFactory) context.lookup("/jms/RemoteConnectionFactory");
    Topic topic = (Topic) context.lookup("RemoteTopic");
    TopicConnection topicConnection = topicConnectionFactory.createTopicConnection("jmsuser", "jmspassw0rd");
    TopicSession topicSession = topicConnection.createTopicSession(false, TopicSession.AUTO_ACKNOWLEDGE);
    topicSession.createSubscriber(topic).setMessageListener(new TopicConsumer());
    System.out.println("----- Exiting Main for TopicConsumer -----");

    public static Context getInitialContext() throws NamingException {
    Properties props = new Properties();
    props.setProperty("java.naming.factory.initial", "org.jboss.naming.remote.client.InitialContextFactory");
    props.setProperty("java.naming.provider.url", "remote://");
    Context context = new InitialContext(props);
    return context;