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 » General IBM MQ Support » Channel Status PCF Error on VB.NET

Post new topic  Reply to topic
 Channel Status PCF Error on VB.NET « View previous topic :: View next topic » 
Author Message
mfuini
PostPosted: Wed Feb 09, 2005 10:49 am    Post subject: Channel Status PCF Error on VB.NET Reply with quote

Novice

Joined: 20 Jan 2005
Posts: 15

I tried to port over the Java code to do this. I am trying to get the channel status using VB.NET CSD08 - I can't tell if it is a coding error or the functionality that I am using is incomplete.

Here is the information from the exception when the Send method is executed.

Error: 2/9/2005 1:45:31 PM- Message:Unknown type
Error: 2/9/2005 1:45:31 PM- Stack Trace: at IBM.WMQ.PCF.PCFParameter.NextParameter(MQMessage message)
at IBM.WMQ.PCF.PCFMessage..ctor(MQMessage message)
at IBM.WMQ.PCF.PCFMessageAgent.Send(PCFMessage request, Boolean check)
at IBM.WMQ.PCF.PCFMessageAgent.Send(PCFMessage request)

Any help would be really appreciated.

Public Sub ChannelStatus()

Dim targetName As String = "*"

' set up the PCF agent
Dim agent As PCFMessageAgent = New PCFMessageAgent
Dim responses() As PCFMessage
agent.Connect(MQM)

' build a request
Dim request As PCFMessage = New PCFMessage(CMQCFC.MQCMD_INQUIRE_CHANNEL_STATUS)
' add a parameter designating the name of the channel for which status is requested
request.AddParameter(CMQCFC.MQCACH_CHANNEL_NAME, targetName)
' add a parameter designating the instance type (current) desired
request.AddParameter(CMQCFC.MQIACH_CHANNEL_INSTANCE_TYPE, IBM.WMQ.MQC.MQOT_CURRENT_CHANNEL)
' add a parameter designating the attributes desired, but first...
' ...build an array list of attributes desired
Dim attrs(5) As Integer

attrs(0) = CMQCFC.MQCACH_CHANNEL_NAME
attrs(1) = CMQCFC.MQCACH_CONNECTION_NAME
attrs(2) = CMQCFC.MQIACH_MSGS
attrs(3) = CMQCFC.MQCACH_LAST_MSG_DATE
attrs(4) = CMQCFC.MQCACH_LAST_MSG_TIME
attrs(5) = CMQCFC.MQIACH_CHANNEL_STATUS

' ...now add the parameter for these attributes
request.AddParameter(CMQCFC.MQIACH_CHANNEL_INSTANCE_ATTRS, attrs)

Dim i As Integer
Dim chlCount As Integer
Try

' send the request and collect the responses
responses = agent.Send(request)

For i = 0 To responses.Length - 1

' get the channel name and trim the spaces
Dim temp As String = responses(i).GetStringParameterValue(CMQCFC.MQCACH_CHANNEL_NAME)
Dim channelName As String = temp.Trim()
' get the channel name and trim the spaces
temp = responses(i).GetStringParameterValue(CMQCFC.MQCACH_CONNECTION_NAME)
Dim connectionName As String = temp.Trim()
' get the channel last message date/time
temp = responses(i).GetStringParameterValue(CMQCFC.MQCACH_LAST_MSG_DATE)
Dim lstMsgDate As String = temp.Trim()
temp = responses(i).GetStringParameterValue(CMQCFC.MQCACH_LAST_MSG_TIME)
Dim lstMsgTime As String = temp.Trim()
' get the channel current messages total
Dim totalMsgs As Integer = responses(i).GetIntParameterValue(CMQCFC.MQIACH_MSGS)
' get the channel status
Dim chlStatus As Integer = responses(i).GetIntParameterValue(CMQCFC.MQIACH_CHANNEL_STATUS)
If chlStatus <> CMQCFC.MQCHS_INACTIVE Then
' System.out.println(" chlStatus = " + chlStatus)
chlCount = chlCount + 1
End If

Logger.LogInfo("chl: " + channelName + " IP: " + connectionName + " msgs: " + CStr(totalMsgs) + _
" last msg time: " + lstMsgDate + " " + lstMsgTime + " status: " + CStr(chlStatus))

Logger.LogInfo(targetName + " count=" + chlCount)

Next
Catch e As Exception
Logger.LogError("Message:" + e.Message)
Logger.LogError("Stack Trace:" + e.StackTrace)
Logger.LogError("Source:" + e.Source)
Catch pcfEx As PCFException
Logger.LogError(pcfEx.Message)
Finally
agent.Disconnect()
End Try
End Sub
_________________
Mark Fuini
markfuini@yahoo.com
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » General IBM MQ Support » Channel Status PCF Error on VB.NET
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.