ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » IBM MQ API Support » MQ Series access from ASP Pages

Post new topic  Reply to topic
 MQ Series access from ASP Pages « View previous topic :: View next topic » 
Author Message
ASheriff
PostPosted: Tue Feb 05, 2002 9:05 am    Post subject: Reply with quote

Newbie

Joined: 04 Feb 2002
Posts: 1
Location: India

Hi,
We are accessing MQ from a ASP page by calling a ATL COM component (coded in C++). This same component is used from VB and VC clients and we have no problems. But the access from ASP takes a time delay of 70 seconds between every subsequent MQ Calls, this happens even for a simple Queue Manager Connection. We are not having many open connections to MQ. Given below is the snippet of the COM Component and ASP Page accessing it -

COM Component :
---------------

STDMETHODIMP CMqTest::Display(BSTR *result)
{
ImqQueueManager DestQMgr;
ImqQueue qDes;
ImqMessage msg;
ImqPutMessageOptions pmo;
ImqChannel *pChannel2=0;
pChannel2=new ImqChannel;
char *retMsg=NULL;
char *cErrMsg;
int lReasoncode;
char *buffer=NULL;
pChannel2->setConnectionName("172.27.140.131(1430)");
pChannel2->setTransportType(MQXPT_TCP);
pChannel2->setChannelName("SYSTEM.DEF.SVRCONN");
DestQMgr.setChannelReference(pChannel2);
DestQMgr.setName("TEST");
if(!DestQMgr.connect())
{
cErrMsg = "ImqQueueManager::Connect failed with reason code";
lReasoncode = DestQMgr.reasonCode( );
if(pChannel2)
delete pChannel2;
CComBSTR var1("NULL");
*result=var1.Detach();
return S_FALSE;
}
qDes.setConnectionReference(DestQMgr);
qDes.setName("TQUEUE");
qDes.setOpenOptions(MQOO_OUTPUT);
qDes.open();
if(qDes.reasonCode())
{
cErrMsg = "ImqQueue::qServer::open ended with reason code";
lReasoncode = qDes.reasonCode( );
if (!DestQMgr.disconnect())
{
cErrMsg = "ImqQueueManager::disconnect ended with reason code";
lReasoncode =DestQMgr.reasonCode( );
}
if(pChannel2)
delete pChannel2;
CComBSTR var1("NULL");
*result =var1.Detach();
return S_FALSE;
}
msg.useFullBuffer(buffer, strlen(buffer));
long buflen=strlen(buffer);
msg.setMessageId();
msg.setCorrelationId();
msg.setFormat(MQFMT_STRING);
msg.setMessageLength(buflen);
if (!qDes.put(msg, pmo))
{
cErrMsg = "ImqQueue::put ended with reason code";
lReasoncode = qDes.reasonCode( );
retMsg ="NULL";
}
else
{
retMsg ="OK";
CComBSTR var1(retMsg);
*result =var1.Detach();
}
return S_OK;
}

ASP Program :
-------------

%@ Language=VBScript %>
<HTML>
<HEAD>
</HEAD>
<BODY>
<%
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Dim obj
Dim retVal
Dim Content ' for sending to Queue
Set obj=server.CreateObject("MQCOMTEST.MqTest")
Response.Write "After CreateObject!! <br>"

retVal=obj.Display()
Response.Write "Return Value from :"& retVal
response.write ("test")
response.end
Set obj=Nothing

Any help on this will be appreciated.

Cheers
Aejaz
Back to top
View user's profile Send private message
shubha6249
PostPosted: Wed Jan 29, 2003 11:22 pm    Post subject: Delay in Connecting QManager Reply with quote

Newbie

Joined: 27 Dec 2002
Posts: 4

Although I have not worked with COM objects but I got the same problem while working with CORBA. I solved this problem by building the application with threaded mqseries libraries like mqm_r.sl and imq23h_r.sl in HP-UX.

U can try building the COM dll with threaded libraries. May be u r having the same problem.

Thnx.

Shubhashis
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » IBM MQ API Support » MQ Series access from ASP Pages
Jump to:  



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.