IBM MQ get topic name from message in subscription queue - c

I am using 'c-client' api to access the Websphere IBM MQ 8. Is it possible to identify the source topic from which the message was published ?

To inquire on the topic string, use the MQCRTMH API call to obtain a message handle, then inquire the properties of the message using the MQINQMP API call specifying the MQTopicString property.
MQCRTMH - Create message handle
MQINQMP - Property Names
Sample IBM MQ procedural programs
Admittedly, it can be difficult to track this info down in the IBM MQ reference documentation, especially if you do not already know the way it works and the names of the calls and fields. One approach that can help is to start with the sample programs to get a basic understanding and then work back into the manuals to fill in the missing details. The sample code is available from the install media by selecting the appropriate optional component.
On Windows these end up in {MQM Home}/Tools and on UNIX systems at {MQM Home}/samp. If the samples are installed, AMQSIQMA will demonstrate how to inquire properties of a message handle, and is an example of the use of the MQINQMP API call.

To inquire on the topic string, use the MQCRTMH API call to obtain a
message handle, then inquire the properties of the message using the
MQINQMP API call specifying the MQTopicString property.
The correct message property name is 'mqps.Top' (case sensitive & no quotes).

Related

Read Gnome Shell Notifications

I need to read the gnome-shell notifications to send an e-mail whenever event X happens (like a torrent was successfully downloaded). Is there a file or a callback that I can read/set in C code?
A very easy option would be to call the notify-send tool from your code. It is used like this:
notify-send [OPTION...] <SUMMARY> [BODY] - create a notification
For more information, see the accompanying man-page.
Edit: I first read this question wrong and thought you wanted to send notifications. For reacting to notifications, I would suggest writing a gnome-shell extension. There is already an example extension that shows how to react to all notifications.
I am not aware of any callbacks for your own code, sorry. But you could probably roll your own notification callback via DBUS. See the DBUS homepage for more details. In short, your shell extension could generate an appropriate DBUS message, to which your program then could react.
Sorry for my reading error :)

IBM Message Broker running on linux needs to call windows executable. Can it be done?

The scenarios is:
IBM WMB V8 running on linux has a list of user id's given to it in an MQ message. For each user id I need to connect to a windows box (samba share probably) and then pass this user id to a windows executable i.e.
C:\temp\command.exe 1234
C:\temp\command.exe 5678
the output from this command will return an image of this user from a database output to a directory.
WMB then goes and retrieves this image and somehow maps (user id => image) and updates a database somewhere.
Is this scenario possible in WMB without involving some other processor on the windows machine?
I can't see any nodes to help with this and I'm expecting i'll have to dump the userid list in a file and use perl or similar to process the command & image capture and return these to WMB as a message or something.
Regards,
Sapatos
Seems like a hard task. You can call arbitrary C-code and code custom nodes in C, so it's not impossible, since you could probably do most things with C and the Internet of libraries.
It seems like you would save yourself months of trouble by setting up a simple service on the windows box, for instance something listening to MQ, invokes the command then replies with the image.
You have not missed any thing. There are not any built in functionallity in WMB for this task. At least not when running on non windows platforms.

Controlling Name Resolution server (DNS) address per request

Looking for ideas on how to generate a Name Resolution request and specify to which server to dispatch the request.
I'm working on Linux.
Up until now, I found two options:
Use an external library which can be hooked for achieving this.
Anyone knows a reliable DNS library that can be used for a production system?
Use Network Namespaces to virtualize the stack and use mounting to link the name resolution server files per namespace (see iproute2 latest version). Requests issued from each namespace may have different servers.
please share your thoughts...
Linux actually comes with a resolver API. See the man(3) page for 'resolver', and link your application with -lresolv.
The libsres library (dnsval) from the DNSSEC-Tools project definitely lets you send queries to a particular server. I know because I've done just that inside the DNSSEC-Check application, which is also part of the DNSSEC-Tools project.

Calling Communicator.UIAutomation from Silverlight 4

I'm trying to instantiate a COM connection to Communicator 2007 from an Out of Browser Silverlight 4 app. I'm following some sample code - one (slightly different) example of which is here - but I'm getting an error when I run the following line:
dynamic communicator = AutomationFactory.CreateObject("Communicator.UIAutomation");
The error is:
Failed to create an object instance for the specified ProgID.
I've downloaded and installed what I believe is the right SDK, but OLEView isn't showing the DLL's as registered - is there something I need to do to register the DLL's in the SDK? regsvr32 doesn't seem to work.
Am I going about this all wrong? Is there a better option, perhaps with the Unified Communications Client (1.0 or 2.0) SDK?
Is Communicator running at the time? It must be running in order to use the API.
The above code works fine for me, when communicator is running, but I can replicate your error by ensuring that it isn't running when the above line gets hit.
I'm pretty sure the SDK is registered OK, as you'g get a slightly different error if it wasn't:
No object was found registered for specified ProgID.
With regards to the right SDK - it depends on what you're trying to achieve. The automation API (i.e. the one you're using) will allow you to automate the running instance of Communicator, so its great for e.g. obtaining presence info, starting IM conversations, placing phone calls etc uning the Communicator UI. You should only need to look at UCCA if its not guaranteed that Communicator will be running, or if you need to e.g. provide your own UI.
I blogged about the various APIs here
One more thing to bear in mind, if upgrading to Lync is an option, then the SDK has a whole bunch of really useful Silverlight/WPF controls built in - some info here

How can an IBM WebSphere MQ's Queue Manager's local queues be enumerated?

I'm trying to write a simple tool for monitoring the state of a Queue Manager. One of the things I'd like to monitor is the current queue depth of each queue. I haven't been able to find a way to programmatically enumerate all of the queues on a particular Queue Manager, though. Do any of the MQ APIs provide this functionality? I'd prefer to do this with C, but if it's only possible with another language's bindings, I'd at least like to know that.
Several C samples at Capitalware. Look for the ones that use the MQAI interface. Nothing there that enumerates queues but the MQAI programs all use Programmable Command Format (PCF) messages. Enumerating the list of queues is a PCF equivalent of DIS Q(*).
You will also want to review the PCF manual in the Infocenter
Tried to add this as a comment but the links didn't markup as expected:
One way or another you end up at PCF commands if you are doing this remotely. You can run MQSC script commands remotely if you install the WMQ client and use SupportPac MO72 to convert them to PCF if you want but at the QMgr it's ultimately PCF. I do a lot of central inquiry and reporting on WMQ with scripts that iterate over a list of QMgrs and execute MO72. I once used CGI and wrote a web front-end over MO72.
By the way, SupportPac MO71 will do the type of monitoring that you are describing. It's compiled C so it needs the WMQ client installed but it can be set up to monitor depth of queues and even has a mini web server so many people can use the same MO71 instance.
You should look at using GH Tester, its a middleware test automation tool developped by Green Hat:
http://www.greenhat.com

Resources