Tuesday, 13 April 2010

A Win32Exception is thrown - The file size exceeds the limit allowed and cannot be saved

Currently we got an exception A Win32Exception is thrown - The file size exceeds the limit allowed and cannot be saved. It seems it is a bug from Windows after searching online for a while.
My colleague confirmed this with his change set although I do not know it works or not. And he referred to an article about this exception. The link is here http://daniel-richardson.blogspot.com/2008/12/handling-eventlogentrywritten-event-for.html

"A Win32Exception is thrown if EnableRaisingEvents is set to true on an empty EventLog. The exception message is "The file size exceeds the limit allowed and cannot be saved".
The workaround for this is to check if the EventLog is empty and write an entry if necessary before setting EnableRaisingEvents to true."
Or you do not set EnableRaisingEvents to true for no good reason.

Thursday, 1 April 2010

ActiveMQ Message Routing

There are several things to think about when you design the ActiveMQ message routing.

1) JMS Selectors. Selectors are a way of attaching a filter to a subscription to perform content based routing. Selectors are defined using SQL 92 syntax and typically apply to message headers; whether the standard properties available on a JMS message or custom headers you can add via the JMS code.
ActiveMQ message properties and JMS message properties should be considered when using JMS selectors.

2) Wildcards. ActiveMQ supports destination wildcards to provide easy support for federated name hierarchies. A subscriber could use wildcards to define hierarchial pattern matches to the destinations to subscribe from. Note wildcards are not part of the JMS specification so are custom enhancements.
I think this feature is quite useful when some messages are only interesting to part of the consumers and relation structure is complex.

3) Advisory Message. It is kind of administrative information of ActiveMQ which helps to watch the system by subscribing to regular JMS messages. By default this is disabled.

4) Message Redelivery. Messages are redelivered to a client when any of the following occurs:

  1. A transacted session is used and rollback() is called.
  2. A transacted session is closed before commit is called.
  3. A session is using CLIENT_ACKNOWLEDGE and Session.recover() is called.
(DLQ means dead letter queue)