|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
.NET WMQ failing Put Message with reason code 2102 |
« View previous topic :: View next topic » |
Author |
Message
|
rafi_net |
Posted: Wed May 16, 2007 3:03 pm Post subject: .NET WMQ failing Put Message with reason code 2102 |
|
|
Newbie
Joined: 16 May 2007 Posts: 3
|
I am currently working on an .net console application that needs to put a file on MQ Queue.
The following is the module I use for MQ Put. The problem I face is the application runs fine the first two times and the messages are seen in the target queus as expected but on the third run application fails at >> InputQueue.Put(MQMsg, pmo) <<
I am not able to figure the reason, I am totally new to MQ.
I use VS.net 2003 and Web Sphere MQ 6.0
Hopw I am clear in the post, let me know of any questions and/or comments.
Thanks,
Rafi
Imports System
Imports System.IO
Imports System.IO.FileStream
Imports System.Text
Imports System.Text.StringBuilder
Imports IBM
Imports IBM.WMQ
Module MQModule
Public Sub PutMessageOnMQ(ByVal FileName As String, ByVal QueManager As String, ByVal InQueName As String, ByVal FileName_Archieve As String)
'Dim QueManager As String
'Dim InQueName As String
Dim qMgr As MQQueueManager
Dim InputQueue As MQQueue
Dim MQMsg As MQMessage
Dim pmo As MQPutMessageOptions
Dim oFileStream As FileStream
Dim btFile As Byte()
Dim btMsg As Byte()
' Read file and convert into byte() for transfer to MQ
oFileStream = File.Open(FileName, FileMode.Open)
ReDim btFile(oFileStream.Length)
oFileStream.Read(btFile, 0, Convert.ToInt32(oFileStream.Length))
oFileStream.Close()
Try
qMgr = New MQQueueManager(QueManager)
Dim InOpenOptions As Integer = MQC.MQOO_OUTPUT Or MQC.MQOO_FAIL_IF_QUIESCING
InputQueue = qMgr.AccessQueue(InQueName, InOpenOptions)
MQMsg = New MQMessage
MQMsg.Write(btFile)
pmo = New MQPutMessageOptions
InputQueue.Put(MQMsg, pmo)
Catch ex As MQException
Console.WriteLine(ex.Message.ToString())
Dim ofs As FileStream
Dim osw As StreamWriter
ofs = File.Open("C:\XXX\ErrorLog.txt", FileMode.Append, FileAccess.Write)
osw = New StreamWriter(ofs)
osw.WriteLine("Error: " & ex.Message.ToString() & " occurred on " & DateTime.Now().ToString("MM/dd/yyyy HH:mm:ss"))
osw.WriteLine("Reason Code: " & ex.ReasonCode)
osw.WriteLine(vbCrLf)
osw.Close()
ofs.Close()
Catch e As Exception
Console.WriteLine(e.Message.ToString())
Finally
InputQueue.Close()
qMgr.Disconnect()
File.Move(FileName, FileName_Archieve) 'Archieve the file after dumping the data on MQ Queue
End Try
End Sub
End Module |
|
Back to top |
|
 |
Vitor |
Posted: Thu May 17, 2007 12:03 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
If you're getting 2102 (which as I'm sure you've discovered is MQRC_RESOURCE_PROBLEM) then the implication is that the queue manager is short of something, probably memory.
Verify your installation with some of the samples provided. Also check the state of your box. And confirm that's really the first reason code you get. Unless you've got some serious issues it's not a code I'd expect from sure a small program. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
rafi_net |
Posted: Thu May 17, 2007 8:16 am Post subject: |
|
|
Newbie
Joined: 16 May 2007 Posts: 3
|
The contact admin here searched through the Logs and found out that as the file size was big nearly 3.6MB the logs were getting full and hence the application was failing on multiple runs.
The Q-Manages were recreated with linear logging (earlier there was linear logging) and the problem dissappeared.
Thanks for the Help
Rafi. |
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
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
|
|
|
|