TIBCO JMS错误无效会话状态代码< 20>

时间:2014-01-15 09:16:35

标签: c++ session queue tibco

我将使用C / C ++和TIBCO库开发JMS队列发件人程序。我想通过相应的队列发送短信。不幸的是我收到错误消息。您可以确定所有属性和登录凭据都是正确的

TIBCO错误无效的会话状态代码< 20>

我的代码如下所示

// Attributes
    tibems_status m_tStatus; // Returncodes
    tibemsErrorContext m_tErrorContext; // Contains errormsgs
    tibemsConnection m_tConnection; // The Tibco connection
    tibemsDestination m_tDestination; // Tibco Destination
    tibemsSession m_tSession; // Tibco Session
        tibemsTextMsg m_tMsg;
    tibemsConnectionFactory m_tFactory;
    tibemsMsgProducer m_tProducer;

    //login Credentials
    string m_sJmsServer; //www.test.com
    string m_sJmsUser;   //admin
    string m_sJmsPassword; //123456
    string m_sQueueName;  //MY.QUEUE.REPLY

    /* Create a connection factory. */
      m_tFactory = tibemsConnectionFactory_Create();

    /* Set the server URL */
    m_tStatus = tibemsConnectionFactory_SetServerURL(m_tFactory, sJmsServer.c_str());

    /* Create a connection object */
    m_tStatus = tibemsConnectionFactory_CreateConnection(m_tFactory,
      &m_tConnection, sJmsUser.c_str(), sJmsPassword.c_str());

    /* Create a Destination  */
     m_tStatus = tibemsDestination_Create(&m_tDestination,TIBEMS_QUEUE,m_sQueueName.c_str() 

     /* Create a text message */
     m_tStatus = tibemsTextMsg_Create (&m_tMsg);

     /* Set the data string of a text message  */
     m_tStatus = tibemsTextMsg_SetText(m_tMsg, pszMessage);

     /* Create a Producer  */
     m_tStatus = tibemsSession_CreateProducer (m_tSession,&m_tProducer, m_tDestination);

     /* Create a Session */
     m_tStatus =  tibemsSession_CreateTextMessage(m_tSession,&m_tMsg );

代码序列是否正确?我在哪里做错了?错误消息表明会话无效。如何为队列创建会话?

非常感谢

0 个答案:

没有答案