Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6347727
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T21:16:36+00:00 2026-05-24T21:16:36+00:00

Is there a way to configure Acknowledgements with Spring.NET? In code it looks like

  • 0

Is there a way to configure Acknowledgements with Spring.NET?

In code it looks like this:

var msgQ = new MessageQueue(OrdersQueueName)
           {
             DefaultPropertiesToSend =
             {
               AcknowledgeType = AcknowledgeTypes.FullReachQueue |
                                 AcknowledgeTypes.FullReceive,
               AdministrationQueue = new MessageQueue(AckQueueName)
             }
           };

Could it be done with the ProductTemplate? Another way?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T21:16:37+00:00Added an answer on May 24, 2026 at 9:16 pm

    For me, this configuration worked:

    <objects xmlns="http://www.springframework.net">
    
      <!-- for http://stackoverflow.com/questions/3491152/configuring-acknowledgements-with-spring-net -->
    
      <object name="orders" type="q3491152.MessageQueue, q3491152">
        <property name="Name" value="orders-from-xml" />
        <property name="DefaultPropertiesToSend">
          <object type="q3491152.PropertiesToSend, q3491152">
            <property name="AdministrationQueue" ref="anotherQ" />
            <property name="AcknowledgeType" 
                      expression="T(q3491152.AcknowledgeTypes).FullReachQueue or T(q3491152.AcknowledgeTypes).FullReceive" />
          </object>
        </property>
      </object>
    
      <object name="anotherQ" type="q3491152.MessageQueue, q3491152">
        <property name="Name" value="anotherQ" />
      </object>
    
    </objects>
    

    In this example I mocked the (apparently) relevant parts of the msmq classes.
    I use an expression to get a bit-wise comparison on the enum.

    If you register the AcknowledgeType with the Spring.Core.TypeResolution.TypeRegistry using TypeRegistry.RegisterType("AcknowledgeTypes", typeof(AcknowledgeTypes));, the expression further simplifies to:

    <property name="AcknowledgeType" 
              expression="AcknowledgeTypes.FullReachQueue or AcknowledgeTypes.FullReceive" />
    

    I’ve tested it with the following program, against Spring.NET 1.3.1:

    using System;
    using Spring.Context;
    using Spring.Context.Support;
    
    namespace q3491152
    {
        internal class Program
        {
            private static void Main(string[] args)
            {
                IApplicationContext ctx = new XmlApplicationContext("objects.xml");
    
                var qFromCode = new MessageQueue
                                    {
                                        Name="orders-from-code",
                                        DefaultPropertiesToSend =
                                            {
                                                AcknowledgeType = AcknowledgeTypes.FullReachQueue |
                                                                  AcknowledgeTypes.FullReceive,
                                                AdministrationQueue = new MessageQueue()
                                            }
                                    };
    
                var qFromXml = (MessageQueue) ctx.GetObject("orders");
    
                PrintQ(qFromCode);
                PrintQ(qFromXml);
    
                Console.ReadLine();
            }
    
            private static void PrintQ(MessageQueue q)
            {
                Console.WriteLine("Q: {0}; AcknowledgeType: {1}", q.Name, q.DefaultPropertiesToSend.AcknowledgeType);
            }
        }
    
        public class MessageQueue
        {
            public MessageQueue()
            {
                DefaultPropertiesToSend = new PropertiesToSend();
            }
    
            public string Name { get; set; }
            public PropertiesToSend DefaultPropertiesToSend { get; set; }
        }
    
    
        public class PropertiesToSend
        {
            public AcknowledgeTypes AcknowledgeType { get; set; }
            public MessageQueue AdministrationQueue { get; set; }
        }
    
        [Flags]
        public enum AcknowledgeTypes
        {
            None = 0,
            FullReachQueue,
            FullReceive
        }
    }
    

    Which outputs:

    Q: orders-from-code; AcknowledgeType: FullReachQueue, FullReceive
    Q: orders-from-xml; AcknowledgeType: FullReachQueue, FullReceive
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there a way to configure ASP.NET in IIS7? I know this must be
My first day using this IDE... is there a way to configure the IDE
Is there a way to configure how the header of an alert dialog looks?
Is there way to configure the objects from inside the code rather than configuring
Is there a way to configure eclipse to open console apps in a new
is there a way to configure spring security to have a default user (with
Is there a way to configure spring application context so it will initialize the
I hope I can explain this clearly.. Is there a way to configure the
Is there a way to configure ASP.NET SqlMembershipProvider such that Email is optional but
Is there a way to configure the directory where all the configuration files are

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.