Reputation: 8581
I am trying to fetch some information/data from (IBM) Websphere MQ using C#.
I did manage to get a message, but i can't figure out how to get details about the queue (e.g. are there any items, how many items are contained, etc).
Not Sure if it matter, but i use MQ 6.1 - the online API for c# provided by IBM is quite empty.
Any suggestions welcome.
Upvotes: 1
Views: 1378
Reputation: 31832
The information you want is available as queue object properties. Some properties are settable, all are gettable. The app needs to have inquire and/or set rights on the queue in order for these to work.
The link you provided in the comment to Stephen's response is to a different section of the WMQ .Net manual. I suspect you are viewing it with curl or otherwise have script disabled or else you would have easily found the section I linked to above in the navigation panel. Any page loaded in a suitable browser will reload itself inside the navigation frame and display a table of contents on the left. The table of contents will be positioned on the page opened. The section you referenced was to compiling the .Net app but there is a complete API reference elsewhere.
I would recommend viewing the Infocenter in a Javascript-enabled browser with cookies, or else installing the local version of the Infocenter as an Eclipse workbench. The local version has the ability to pull down updates when the online manuals are updated. In either case, a navigation panel is provided which includes the complete set of WMQ manuals and is searchable across all of them, by individual book or by section within a book.
The landing page for WMQ documentation is here. This page contains links to the online Infocenters for v6 and v7, the downloadable Infocenters for v6 & v7 and the PDF versions of the older documentation.
EDIT - The drill-down path to definitions of the constants
Upvotes: 3
Reputation: 212
In the past I have used XMS: The IBM Message Service Client for .NET. The current version can be found at: IBM Message Service Client. You can also find a quick tutorial at C# Corner
In general you want to follow the pattern:
MQCONN
MQOPEN the queue
loop
MQGET from the queue
Process the message
end loop
Make sure you specify MQGMO_WAIT on the MQGET call. You don't want to just poll the queue.
I'll try to find some source code when I get to the office.
Upvotes: 0