Enterprise Library Distributor Service

Topics: Logging Application Block
Jul 23, 2009 at 12:43 PM

I have installed "Enterprise Library Distributor Service" to receive the messages from MSMQ and the same should be posted to SQL Server.

If the SQL Server is live then the messages are posted to the database successfully and messages are getting deleted from MSMQ.

This is fine.

Major problem is if the SQL Server is down still the Distributor is deleting the messages without checking for the SQL Server availablity.

Please let me know is there is any solution to hold the messages in MSMQ if the SQL Server is down.

Thanks

Madhusudhana Reddy N

Jul 24, 2009 at 9:10 AM

Hi,

Can you please try setting the Recoverable property of the Msmq trace listener to true.

Valiant Dudan
Global Technology and Solutions
Avanade, Inc.
entlib.support@avanade.com

Jul 24, 2009 at 9:58 AM

Hi Valiant,

Thank you for your response.

I set the property in app.config, it was false initially. But still the message expired. Is there any work around for this.

<add name="Msmq TraceListener" type="Microsoft.Practices.EnterpriseLibrary.Logging.TraceListeners.MsmqTraceListener, Microsoft.Practices.EnterpriseLibrary.Logging, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"

listenerDataType="Microsoft.Practices.EnterpriseLibrary.Logging.Configuration.MsmqTraceListenerData, Microsoft.Practices.EnterpriseLibrary.Logging, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"

traceOutputOptions="None" filter="All" queuePath="FormatName:DIRECT=OS:orbita-DEV\PRIVATE$\OCSLogQueue"

formatter="Binary Formatter" messagePriority="Normal" timeToReachQueue="49710.06:28:15"

timeToBeReceived="49710.06:28:15" recoverable="true" useAuthentication="false"

useDeadLetterQueue="false" useEncryption="false" transactionType="None" />

Regards

Madhusudhana Reddy N

Infotech Enterprises Ltd.

Plot No.11 Software Units Layout

Infocity, Madhapur

Hyderabad – 500081

Tel: +91 - 40 - 23110357/8- Ext: 1596

Mob: +91-9959637770


From: AvanadeSupport [mailto:notifications@codeplex.com]
Sent: Friday, July 24, 2009 1:41 PM
To: madhusudhanareddyn@infotechsw.com
Subject: Re: Enterprise Library Distributor Service [entlib:63312]

From: AvanadeSupport

Hi,

Can you please try setting the Recoverable property of the Msmq trace listener to true.

Valiant Dudan
Global Technology and Solutions
Avanade, Inc.
entlib.support@avanade.com

Read the full discussion online.

To add a post to this discussion, reply to this email (entlib@discussions.codeplex.com)

To start a new discussion for this project, email entlib@discussions.codeplex.com

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe on codePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at codeplex.com

Jul 27, 2009 at 5:45 AM

Unfortunately, there's no configurable property to turn on/off this behavior in the msmqDistributorSettings.  You would have to modify the source code.  If you're going to look at the ReceiveQueuedMessages method of the MsmqLogDistributor class, it has the following lines of code:

if (logEntry != null)
{
         logWriter.Write(logEntry);
}

message = msmq.Receive();

As you may have already know, the Logging Application Block is designed to fail gracefully in case of exceptions including if one or all of the tracelisteners failed to do logging.  So even if an exception occured while calling logWriter.Write, it is not propagated to the calling method.  Thus, the msmq.Receive will always be called. 

Modifying the current behavior would require you to add a way for determining if an exception occured while logging.  The simplest would be to modify the Write method of the LogWriter class to return a boolean indicating the logging is successful or not.

 

Sarah Urmeneta
Global Technology and Solutions
Avanade, Inc.
entlib.support@avanade.com

Jul 27, 2009 at 5:48 AM

Thank you very much.

Regards

Madhusudhana Reddy N


From: AvanadeSupport [mailto:notifications@codeplex.com]
Sent: Monday, July 27, 2009 10:15 AM
To: madhusudhanareddyn@infotechsw.com
Subject: Re: Enterprise Library Distributor Service [entlib:63312]

From: AvanadeSupport

Unfortunately, there's no configurable property to turn on/off this behavior in the msmqDistributorSettings. You would have to modify the source code. If you're going to look at the ReceiveQueuedMessages method of the MsmqLogDistributor class, it has the following lines of code:

if (logEntry != null)
{
         logWriter.Write(logEntry);
}
 
message = msmq.Receive();

As you may have already know, the Logging Application Block is designed to fail gracefully in case of exceptions including if one or all of the tracelisteners failed to do logging. So even if an exception occured while calling logWriter.Write, it is not propagated to the calling method. Thus, the msmq.Receive will always be called.

Modifying the current behavior would require you to add a way for determining if an exception occured while logging. The simplest would be to modify the Write method of the LogWriter class to return a boolean indicating the logging is successful or not.

Sarah Urmeneta
Global Technology and Solutions
Avanade, Inc.
entlib.support@avanade.com

Read the full discussion online.

To add a post to this discussion, reply to this email (entlib@discussions.codeplex.com)

To start a new discussion for this project, email entlib@discussions.codeplex.com

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe on codePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at codeplex.com