Daily Archives: June 9, 2006

On .NET and WebSphere MQ

I was doing a search on other blogs that talk about MQ today, and came across a post from a guy who has been having trouble with the .NET interface.

Here’s my “open letter”-style response to his problems…

Hi. I realise I’m 3 weeks late, but I just came across your blog.

I’m really sorry that you had so much difficulty with the .NET interface for WebSphere MQ. It sounds like it was pretty frustrating. All I can say is that it looks like there is some confusion about the different methods of connection.

First of all, you mention the amqsputc program, which is a C program that enables you to make a client mode connection to a queue manager. You then go on to describe the use of the amqsput program, which uses a bindings mode connection to attach to a queue manager (this only works where the program is running on the same host as the queue manager). By adding those additional parameters after the queue manager name (open options, close options, remote queue manager name) you will actually be asking a local queue manager to forward your message to a remote queue manager.

I agree that the 8208 value is not very helpful. If you look at the source code for amqsput (amqsput0.c in MQ_INSTALL_DIR\Tools\c\Samples) you’ll find that it corresponds to 2 MQ Constants:

O_options = MQOO_OUTPUT  /* open queue for output     */
| MQOO_FAIL_IF_QUIESCING /* but not if MQM stopping  */
;                      /* = 0x2010 = 8208 decimal   */

In a .NET program, you’d specify the same constants, from the MQC object (this snippet is taken from the nmqsput.cs sample):

mqQueue = mqQMgr.AccessQueue( queueName, 
 MQC.MQOO_OUTPUT              // open queue for output
 + MQC.MQOO_FAIL_IF_QUIESCING );// but not if MQM stopping

I actually think that taken together, our documentation and samples for the .NET interface are reasonably good. There’s a section in the Using .NET book (provided as online help) which provides information on Connection differences between bindings and client connections, with example code fragments for each (actually my local copy of the help has the fragments for both, the copy on the website does not seem to currently). The AccessQueue method you mention is also fully documented.

I found that the MSMQ documentation and samples was far worse – plus the methods seem to change in each release, which meant that nine times out of ten it turned out that I was reading inaccurate information about how to use MSMQ.

Anyway, I’m glad you got going in the end. There’s a good independent MQ user site, MQSeries.net, which has forums where you can often find help for these kind of questions. We also have newsgroups.

Maybe this will be of use to others looking to use WebSphere MQ in a C# or .NET environment.

Advertisements

New Broker and MQ Administration tooling!

Very exciting news.

SupportPac IS02 was released today. From the text description, you might be lulled into suspecting that this is just another Eclipse plugin for MQ Explorer. In fact, this is a very cool extension that enables WebSphere Message Broker resources (brokers etc.) to be managed directly alongside your queue managers. It also means that WMB administrators no longer need to install the full Message Brokers Toolkit if all they want to do is perform basic administration tasks such as BAR file deployment, create/start/stop brokers, etc..

Congratulations to the development team. I got to take an early look at this in the lab, so I’m really keen to show it to our customers.

I’d post a screenshot but I don’t have the bandwidth to upload one at the moment. Watch this space.

Towards a better webmail experience

I've got a Linux server that runs on my ADSL connection at home, with a dynamic DNS address so that I can always reach it at the same URL.

The server fetches my email from a number of accounts (I think I'm up to eight), washes it through SpamAssassin to filter the junk, and then sits waiting for me to look at it.

For a number of years, I've run SquirrelMail running on Apache/PHP on the server to enable me to connect and manage my mail over the web. To be honest, this works fine. Recently though, having used GMail and knowing about enhancements to Yahoo! Mail and what-used-to-be-Hotmail, I wondered whether there might be any AJAX-y goodness in the pipeline for SquirrelMail, so I went searching.

I found RoundCube.

RoundCube is pretty funky. Go check the screenshots. It provides a much more application-style interface to my mail, featuring double-click to view, drag-and-drop to move. It is in beta, whereas SquirrelMail is a more mature offering – but it works, and is functional.

Like SquirrelMail, it also runs on Apache/PHP, but also requires a DB backend… I have MySQL sitting on the box supporting a WordPress installation, so that was straightforward, although just another dependency.

I used a combination of a couple of installation guides to get myself up-and-running:

Some general comments….

The documentation is sketchy. The general rule where I've seen users asking for for a user guide is "play with it and see!". This is a bit of a problem, since at the moment I don't see any information on how to DELETE mail. I can see a button that lets me move mail to the Trash, but not to delete it.
Update: actually, I just found it. When you are in the Trash / Deleted Items folder, you need to click Empty at the bottom of the folder list. This makes sense. I'm just dim…

The IMAP folders need to be called Sent, Trash, Drafts (and I think, Junk, although I don't have this configured right now) in order to be shown as special folders in the left-hand sidebar. I used to have SquirrelMail-default names of sentbox, draftbox, etc. and I had to change them in order to get RoundCube to display them with the correct icons.

It seems slower than SquirrelMail, which is not entirely surprising since it has a richer UI.

It doesn't appear to have a plugin architecture, although it might exist and I've just not seen evidence of it. Not sure how complex it would be to extend the application. SquirrelMail has a lot of plugins.

There's a nifty-looking address book, with an export feature, but I don't see an import option…

The range of configuration options seems much more limited than SquirrelMail, but then this is a much newer application and is probably aimed at users with more straightforward requirements. Do I need to be able to specify the text wrap options, HTML display options, etc.? In some ways yes, but if the application has sensible defaults, maybe not.

After reading back over my thoughts, it looks like I'm fairly biased in favour of the "old faithful" SquirrelMail option. Not necessarily. RoundCube is in early development, but it works well, so the future could be very bright indeed. I've got both tools installed, so I'm going to perservere with RoundCube for a while and see how I get on. If you need to have a webmail service of your own, I'd encourage you to give RoundCube a try. You might like it! 🙂

Some other reviews: