How to perform MSMQ Trace - msmq

I'm looking for a way to trace MSMQ activity (API calls, or something similar)
I saw several references mentioning ETW tracing but they weren't very clear or complete.
Is there a simple tutorial about this subject?

There is a utility to do this. Unfortunately, the output is encrypted and the only way to read it is by sending it to MS.
If you have a MS support contract, I'd call them.
http://blogs.msdn.com/b/johnbreakwell/archive/2008/07/09/latest-version-1-5-of-the-logging-script-for-msmq-3-0.aspx
That blog has some great MSMQ troubleshooting tips that might also help.

Related

MSMQ Requirements for Rebus

I'm starting out using Rebus with MSMQ, but I cannot seem to find the requirements for MSMQ.
So in the (Roles|Programs and Features) which options do I need to set and what is the impact wrt to Rebus?
I'm pretty sure I need the Message Queuing Server ;-) But what about the others:
Directory Service Integration
HTTP Support
Message Queuing Triggers
Multicast Support
Routing Service
I think none of these are needed and none of the extra features are supported by Rebus.
I don't think you'll ruin anything by checking one or more of those extra options, but the only requirement for Rebus to work is that you put a single checkmark in the top level Message Queueing Server.
You're absolutely right that I ought to document this on the wiki - it's almost too easy :)

Does JavaMail support server-push?

Does JavaMail support notification of new emails through server-push?
If yes, where is the documentation for that?
If no, is there a library that can do it?
You should be using IMAPFolder's idle function to issue the idle command to the server. That will then listen for events, such as a new mail or deleted mail. (See the IMAP spec to see what the messages look like). And you should be using a MessageCountListener to execute code when a number of emails in the mailbox change.
IMAP's idle function is exactly meant to imitate "push" functionality.
http://java.sun.com/products/javamail/javadocs/javax/mail/event/MessageCountListener.html
http://java.sun.com/products/javamail/javadocs/com/sun/mail/imap/IMAPFolder.html
Sorry I didn't post any code that shows how this is used. I didn't want to waste my time since there are many readily available examples on the internet if you search for this stuff.
But be forewarned, this method won't work for more than one IMAP account since the idle command blocks. Unless you want them all on different threads (bad idea).
A Store event listens for notifications issued by your backend store:
http://java.sun.com/products/javamail/javadocs/javax/mail/event/StoreEvent.html
But in my experience the java mail docs are so thin in places, that the best way of finding out what is going on, is to debug through the process yourself.
This is a great allround resource as well; the JavaMail FAQ :
http://www.oracle.com/technetwork/java/faq-135477.html

Setting up MSMQ for clustering

Can someone point me to some good resources about setting up MSMQ for queue clustering? I'm interested in help with:
Actually setting up the clustered MSMQ nodes, and making it function
Setting up an application to send messages to a clustered queue.
Setting up applications (at least 2) to read from the same clustered queue.
For item 1, here is a nice starting point: "Building MSMQ cluster".
You will find several other links in that article that will guide you further.
Microsoft also has a detailed document: "Deploying Message Queuing (MSMQ) 3.0 in a Server Cluster".
Items 2 and 3 seem to a little bit too much for just one thread.
You might want to use some framework like NServiceBus to work with the queues. NServiceBus comes with example projects that will help you to find a start.

PostgreSQL socket connection

Is it possible to send data on a socket over a TCP?IP connection from a PostgreSQL stored procedure or trigger?
If you know of any useful examples pleas tell me.
If you know of something similar for other data base systems it would also be helpful.
Thanks in advance.
Answer from Milen solves the technical side of the question. But there is also a problem of interactions.
Let's assume you have trigger that does things over TCPIP. This means that the query that launched the trigger can take a long time (think network issues, service issues, firewalls).
Usually much better solution is to store information in some kind of queue, and addition of service, which checks the queue (perhaps using NOTIFY/LISTEN feature of PostgreSQL), and does what's necessary over TCP/IP - with proper handling of long connections, retries and so on.
If you'd be inclined to use such mechanism, you might want to check PgQ from SkyTools.
Yes, it's possible but you have to use one of the "untrusted" languages - PL/perlU, PL/pythonU, etc.
And then all examples you need you'll find in the documentation of the respective language.

What are pros and cons of Msmqdistributor service of Enterprise Library?

We are using EntLib Logging Application Block. And also it turned out that we should use msmq for logging because of performance.
Now we are trying to use Msmqdistributor service to log those messages in the queue.
What are pros and cons of Msmqdistributor service of Enterprise Library?
Please share your experience.
The main drawback is going to be the Microsoft Message Queue (MSMQ) itself. MSMQ has been around for awhile and it is a pretty cool tool. It does however lack utilities. Because of the way that data is stored in the queue, most people end up needing to write some helper utilities for debugging and manually manipulating the queue. Some other things to consider:
Queue size - if too many items get put in the queue, and aren't removed in a timely manner the server can stall.
Purpose - MSMQ is designed for multi-step transactions (such as billing), you mention you are going to use it for logging. If the log is just for debugging, Then a DB table or a flat file or sending errors to a bug tracker will serve you better. If you need complicated logging and are using MSMQ to send the information to a different copmuter, then you will find MSMQ more useful.