You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@activemq.apache.org by "Mark Pollack (JIRA)" <ji...@apache.org> on 2008/07/18 23:53:00 UTC

[jira] Created: (AMQNET-94) Use of AcknowledgmentMode enum and boolean for priority limit use of NMS API for vendor extensions

Use of AcknowledgmentMode enum and boolean for priority limit use of NMS API for vendor extensions
--------------------------------------------------------------------------------------------------

                 Key: AMQNET-94
                 URL: https://issues.apache.org/activemq/browse/AMQNET-94
             Project: ActiveMQ .Net
          Issue Type: Improvement
          Components: ActiveMQ Client
            Reporter: Mark Pollack
            Assignee: James Strachan
            Priority: Minor
             Fix For: 1.0


This came up on the dev mailing list.  The AcknowledgmentMode enumeration lists the standard JMS ack modes.  However, vendors extend that, in particular TIBCO EMS.  This should change to either an Enum, int, or string type so that the API will be more portable.

The same issue exists in the IMessageProducer interface with the boolean value for persistent delivery instead of and int for "DeliveryMode".  TIBCO EMS offers another value for delivery mode.  


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (AMQNET-94) Use of AcknowledgmentMode enum and boolean for priority limit use of NMS API for vendor extensions

Posted by "Mark Pollack (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/AMQNET-94?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=44778#action_44778 ] 

Mark Pollack commented on AMQNET-94:
------------------------------------

Great, didn't know that was possible.  Thanks for the thorough explanation.


> Use of AcknowledgmentMode enum and boolean for priority limit use of NMS API for vendor extensions
> --------------------------------------------------------------------------------------------------
>
>                 Key: AMQNET-94
>                 URL: https://issues.apache.org/activemq/browse/AMQNET-94
>             Project: ActiveMQ .Net
>          Issue Type: Improvement
>          Components: ActiveMQ Client
>            Reporter: Mark Pollack
>            Assignee: Jim Gomes
>            Priority: Minor
>             Fix For: 1.0
>
>
> This came up on the dev mailing list.  The AcknowledgmentMode enumeration lists the standard JMS ack modes.  However, vendors extend that, in particular TIBCO EMS.  This should change to either an Enum, int, or string type so that the API will be more portable.
> The same issue exists in the IMessageProducer interface with the boolean value for persistent delivery instead of and int for "DeliveryMode".  TIBCO EMS offers another value for delivery mode.  

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Assigned: (AMQNET-94) Use of AcknowledgmentMode enum and boolean for priority limit use of NMS API for vendor extensions

Posted by "Jim Gomes (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/activemq/browse/AMQNET-94?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jim Gomes reassigned AMQNET-94:
-------------------------------

    Assignee: Jim Gomes  (was: James Strachan)

> Use of AcknowledgmentMode enum and boolean for priority limit use of NMS API for vendor extensions
> --------------------------------------------------------------------------------------------------
>
>                 Key: AMQNET-94
>                 URL: https://issues.apache.org/activemq/browse/AMQNET-94
>             Project: ActiveMQ .Net
>          Issue Type: Improvement
>          Components: ActiveMQ Client
>            Reporter: Mark Pollack
>            Assignee: Jim Gomes
>            Priority: Minor
>             Fix For: 1.0
>
>
> This came up on the dev mailing list.  The AcknowledgmentMode enumeration lists the standard JMS ack modes.  However, vendors extend that, in particular TIBCO EMS.  This should change to either an Enum, int, or string type so that the API will be more portable.
> The same issue exists in the IMessageProducer interface with the boolean value for persistent delivery instead of and int for "DeliveryMode".  TIBCO EMS offers another value for delivery mode.  

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (AMQNET-94) Use of AcknowledgmentMode enum and boolean for priority limit use of NMS API for vendor extensions

Posted by "Jim Gomes (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/activemq/browse/AMQNET-94?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jim Gomes resolved AMQNET-94.
-----------------------------

    Resolution: Won't Fix

It is possible to change the {{IConnection}} interface to use the following generic types to allow passing in a generic enumeration:
{code:borderStyle=solid}
interface IConnection
{
    //...
    ISession CreateSession(System.Enum acknowledgementMode);
    System.Enum AcknowledgementMode { get; set; }
    //...
}
{code}

However, I think that it will force more code to be written using explicit casting in order to deal with the {{AcknowledgementMode}} property in the most general cases.

Since using provider specific acknowledgment modes is the outlyer case, I think using casting to show specific intent to deviate from standard modes is preferred.  The C# enum type system is robust enough to support the following using the existing interface definition without reverting to generic {{System.Enum}}:

{code:borderStyle=solid|title=Sample of Extant Flexibility}
public interface IConnection : IDisposable, IStartable, IStoppable
{
    //...
    ISession CreateSession(AcknowledgementMode acknowledgementMode);
    AcknowledgementMode AcknowledgementMode { get; set; }
    //...
}

enum MyAckModes
{
    IgnoreDups,
    Transactional,
    Explicit
}

IConnection connection = GetConnection();
// Set the default ack mode
connection.AcknowledgementMode = (AcknowledgementMode) MyAckModes.IgnoreDups;
// Set session-specific ack mode
ISession session = connection.CreateSession((AcknowledgementMode) MyAckModes.Explicit);
{code}

As can be seen from this snippet of code, the existing code base allows the use of provider specific enumerations while providing type-safety and non-casting for the general case.  When a user of NMS wants to have low-level access to a provider's unique acknowledgment modes, then they can do so and the C# enum system will carry their values through, even if that acknowledgment mode value is outside the range of the original {{AcknowledgmentMode}} enumeration.  I have created a sample C# app that demonstrates basic casting of enumerations to show that provider specific enumeration values can be "carried" inside the existing {{AcknowledgementMode}} enumeration.  Since these values only make sense to the individual providers, they will be the ones who will cast when setting/getting the {{AcknowledgementMode}} property.

{code:borderStyle=solid|title=EnumTest.cs}
using System;

public class EnumTest
{
    enum MyEnum        { First, Second, Third }
    enum ProviderEnum  { Fourth, Fifth }

    static void ShowEnum(System.Enum baseEnum)
    {
        Console.WriteLine("base = {0}", baseEnum);
        ProviderEnum derived = (ProviderEnum) baseEnum;
        Console.WriteLine("derived = {0}", derived);
    }

    static void Main()
    {
        ShowEnum(MyEnum.Second);
        ShowEnum(MyEnum.Third);
    }
}
{code}

When this sample application is run, the following is output:

{panel:title=EnumTest output|borderStyle=solid|bgColor=#FFFFCE}
base = Second
derived = Fifth
base = Third
derived = 2
{panel}

I hope that this addresses the concerns about using provider specific extensions to the acknowledgment mode enumeration.  


> Use of AcknowledgmentMode enum and boolean for priority limit use of NMS API for vendor extensions
> --------------------------------------------------------------------------------------------------
>
>                 Key: AMQNET-94
>                 URL: https://issues.apache.org/activemq/browse/AMQNET-94
>             Project: ActiveMQ .Net
>          Issue Type: Improvement
>          Components: ActiveMQ Client
>            Reporter: Mark Pollack
>            Assignee: Jim Gomes
>            Priority: Minor
>             Fix For: 1.0
>
>
> This came up on the dev mailing list.  The AcknowledgmentMode enumeration lists the standard JMS ack modes.  However, vendors extend that, in particular TIBCO EMS.  This should change to either an Enum, int, or string type so that the API will be more portable.
> The same issue exists in the IMessageProducer interface with the boolean value for persistent delivery instead of and int for "DeliveryMode".  TIBCO EMS offers another value for delivery mode.  

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (AMQNET-94) Use of AcknowledgmentMode enum and boolean for priority limit use of NMS API for vendor extensions

Posted by "Jim Gomes (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/activemq/browse/AMQNET-94?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jim Gomes resolved AMQNET-94.
-----------------------------

    Resolution: Working as Designed

Created a new issue [AMQNET-105] to address the separate issue that Mark raised in re-opening this issue.

> Use of AcknowledgmentMode enum and boolean for priority limit use of NMS API for vendor extensions
> --------------------------------------------------------------------------------------------------
>
>                 Key: AMQNET-94
>                 URL: https://issues.apache.org/activemq/browse/AMQNET-94
>             Project: ActiveMQ .Net
>          Issue Type: Improvement
>          Components: ActiveMQ Client
>            Reporter: Mark Pollack
>            Assignee: Jim Gomes
>            Priority: Minor
>             Fix For: 1.0
>
>
> This came up on the dev mailing list.  The AcknowledgmentMode enumeration lists the standard JMS ack modes.  However, vendors extend that, in particular TIBCO EMS.  This should change to either an Enum, int, or string type so that the API will be more portable.
> The same issue exists in the IMessageProducer interface with the boolean value for persistent delivery instead of and int for "DeliveryMode".  TIBCO EMS offers another value for delivery mode.  

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (AMQNET-94) Use of AcknowledgmentMode enum and boolean for priority limit use of NMS API for vendor extensions

Posted by "Mark Pollack (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/AMQNET-94?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=44935#action_44935 ] 

Mark Pollack commented on AMQNET-94:
------------------------------------

Hi,
The issue also related to delivery mode, which is normally an int to allow for vendor extentions (ie. tibco reliable-delivery).  This appears in the NMS API as a boolean with the name 'Persistent'.  This should perhaps then be an enum to benefit from the casting demonstrated above.

> Use of AcknowledgmentMode enum and boolean for priority limit use of NMS API for vendor extensions
> --------------------------------------------------------------------------------------------------
>
>                 Key: AMQNET-94
>                 URL: https://issues.apache.org/activemq/browse/AMQNET-94
>             Project: ActiveMQ .Net
>          Issue Type: Improvement
>          Components: ActiveMQ Client
>            Reporter: Mark Pollack
>            Assignee: Jim Gomes
>            Priority: Minor
>             Fix For: 1.0
>
>
> This came up on the dev mailing list.  The AcknowledgmentMode enumeration lists the standard JMS ack modes.  However, vendors extend that, in particular TIBCO EMS.  This should change to either an Enum, int, or string type so that the API will be more portable.
> The same issue exists in the IMessageProducer interface with the boolean value for persistent delivery instead of and int for "DeliveryMode".  TIBCO EMS offers another value for delivery mode.  

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Reopened: (AMQNET-94) Use of AcknowledgmentMode enum and boolean for priority limit use of NMS API for vendor extensions

Posted by "Mark Pollack (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/activemq/browse/AMQNET-94?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Mark Pollack reopened AMQNET-94:
--------------------------------


reopened to make sure the comment is not lost in the noise...apologies if you didn't want it reopened.

> Use of AcknowledgmentMode enum and boolean for priority limit use of NMS API for vendor extensions
> --------------------------------------------------------------------------------------------------
>
>                 Key: AMQNET-94
>                 URL: https://issues.apache.org/activemq/browse/AMQNET-94
>             Project: ActiveMQ .Net
>          Issue Type: Improvement
>          Components: ActiveMQ Client
>            Reporter: Mark Pollack
>            Assignee: Jim Gomes
>            Priority: Minor
>             Fix For: 1.0
>
>
> This came up on the dev mailing list.  The AcknowledgmentMode enumeration lists the standard JMS ack modes.  However, vendors extend that, in particular TIBCO EMS.  This should change to either an Enum, int, or string type so that the API will be more portable.
> The same issue exists in the IMessageProducer interface with the boolean value for persistent delivery instead of and int for "DeliveryMode".  TIBCO EMS offers another value for delivery mode.  

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.