Enterprise Library Email Trace Listener is killing our mail server - enterprise-library

We're doing stress testing of our application right now and when it blows up we wind up hammering our Exchange server with exception notifications sent via EntLib 4.0 Email Trace Listener.
What strategies can we use to throttle the emails being sent. Is there anything in EntLib for this or does it have to be something configured in Exchange? I'm hoping this can be solved in our App so we don't have to tell the client to make changes to their email server config.
It's either that, or we just disable the Email Trace Listener, which I don't think is a very good option at all.

The e-mail trace listener is really geared up for high throughput of notifications. If you are getting huge numbers of exceptions then this may not be the appropriate mechanism for you.

You should ask yourself what the objective of logging through email was. Then you can adjust the level of severity of log messages (Critical, Error, Warning, Info etc) that need to go through to meet your logging objectives. Notice, 'All' is the default option. You can do this at the level of the TraceListener or by setting up Filters on log categories.

Related

IBM notes client plugin to modify outgoing mail

I have been exploring plugin development for IBM notes.
I have downloaded expeditor toolkit, set up the dev environment, tried out simple plugin as described here
Also I have gone through some openntf projects.
Now I am looking for ways to intercept outgoing mail so that some additional processing can be done, like encrypting attachments.
Is it possible to intercept outgoing mail in notes client plugin?
Some examples/pointer would be appreciated. Thanks.
It is more often done with plugins on the Domino server rather than with client-based code, but in either case intercepting mail messages can be done with the Extension Manager feature of the Notes C API Toolkit. The technique involves hooking NSFNoteUpdate operations to the router mailbox, putting the message on hold so that the routing software will ignore it while the work is done, signaling a separate task to do the work, and then returning control to the client. Then the separate task can take whatever time is needed and then finally release the message from hold to allow the router to move the message.
I'm not sure if it would be possible to do something similar with the expeditor toolkit. It's operating at a higher level, so catching the message before the routing software kicks in may be a problem. It will also only handle manually submitted messages, whereas an Extension Manager solution will also catch messages sent by agents or standalone programs.

MSMQ: How do you send a msg from transactional dead letter queue to a private queue on remote machine

Windows Server 2012
MSMQ 6 Workgroup Mode
We've had issues trying to recover MSMQ messages that were sent to the transaction dead letter queue. We've tried moving them to the outbound queue, the message seems to send fine (even the Event Log says so) however it never gets to the destination queue.
After trial and error we've figured out how to get them to another queue on the same server but not to the destination queue on a remote server. We don't want to lose anymore messages. Does anyone have any suggestion on how we can deliver these messages?
Thank you,
David
As I understood your question, it's a one time problem with some number of messages you already have in MSMQ, and not general connectivity issue between machines? If so, you should be able to solve it with some MSMQ management tool. Disclaimer: I'm the author of one such tool - QueueExplorer. I don't know what other tools can do, but with QueueExplorer you can copy/paste or drag/drop messages to another machine opened in separate tab/window. In order to do that QueueExplorer has to perform MSMQ Send operation, so messages will have to pass through MSMQ between these two machines.
So if there's still that issue that prevented original delivery you'll still be stuck. In that case you can save all messages to a file, transfer it to another machine through file system and load it there to whichever queue they should go. This is obviusly just a manual workaround for one time situation. Btw. this could be done in QueueExplore's trial mode.
If however problem is with connectivity and messages always end up in dead letter queue, it's better to check them from Computer Management. It's one area where it's better than our tool - you can turn on "Class" column and see reason why messages couldn't be delivered. For instance if you see "The time-to-be-received has elapsed" you'll know what's the problem.

capturing incoming FIX messages which fail QuickFix validation

A Quickfix client validates incoming messages using XML spec files. If a message fails validation, quickfix automatically sends a rejection response. AFAIK in this case quickfix does not call the standard callback for incoming messages fromApp(), so up till now I was unable to programatically capture these erroneous incoming messages and handle them.
Is there a way to capture incoming FIX messages which fail quickfix validation?
Of course they may appear in the default quickfix log files, but I would rather capture them in my code in realtime.
There is not.
QuickFIX simply does not consider this a useful feature. If a message is invalid, QF performs the protocol-specified behavior and there is nothing that the application could or should do to recover. Any fix will require developer analysis and xml and/or code fixes, thus log files are sufficient to record the issue.
If you would like an automated alert when such errors occur, I suggest perhaps some kind of external log monitoring app that could watch your logs for occurrences of 35=3 or 35=j. (On the cheap side, a composition of cron/grep actions could do this very easily.)
Validation via XML spec file is in session level processing.
So, there is not suitable hook for this.
On the other hand, there are some configuration parameters;
UseDataDictionary : eliminates validation
ValidateUserDefinedFields : eliminates user defined field's validation
look for detailed descriptions
edit:
If your real problem is monitoring rejections, capturing Reject(3) and BusinessReject(j) messages at toAdmin() hook is sufficient.

What is the purpose of quickfix message store?

What is the purpose of the message store structure in quickfix? I understand that you can log all incoming and outgoing fix messages via the message store interface and quickfix provides multiple implementations like file store etc.
My question is why do you even care about the message store other than logging your fix messages for the record?
You are confusing the MessageStore and the Log, which are two different things.
The MessageStore is for internal engine use. It tracks the current incoming and outgoing message sequence numbers, session start time, and other stuff. If your app goes down for whatever reason, when it restarts, it uses the MessageStore to resume where it left off with regards to sequence number and whether to reset the session.
The Log, however, is just a log. The engine doesn't really care about it. It's for the developers.

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