jms-spec
  1. jms-spec
  2. JMS_SPEC-107

Extend connection consumer API to support shared durable and non-durable subscriptions

    Details

    • Type: New Feature New Feature
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.0PD
    • Fix Version/s: 2.0PD, 2.0
    • Labels:
      None

      Description

      Now that JMS_SPEC-40 has added shared-durable and non-durable subscriptions to JMS, the connection consumer API needs to be extended to support them.

      So in addition to the existing methods on Connection:

      ConnectionConsumer createConnectionConsumer(
         Destination destination, String messageSelector, ServerSessionPool sessionPool, 
         int maxMessages)
      

      (Queues or unshared non-durable topic subscriptions, clientId optional)

      ConnectionConsumer createDurableConnectionConsumer(
         Topic topic, String subscriptionName, String messageSelector, ServerSessionPool sessionPool, 
         int maxMessages)
      

      (Unshared durable topic subscriptions, clientId required)

      we also need

      ConnectionConsumer createSharedConnectionConsumer(
         Topic topic, String subscriptionName, String messageSelector, ServerSessionPool sessionPool, 
         int maxMessages)
      

      (Shared non-durable topic subscriptions, clientId optional)

      ConnectionConsumer createSharedDurableConnectionConsumer(
         Topic topic, String subscriptionName, String messageSelector, ServerSessionPool sessionPool, 
         int maxMessages)
      

      (Shared durable topic subscriptions, clientId optional)

        Issue Links

          Activity

          Hide
          Nigel Deakin added a comment -

          Here are the proposed new methods on Connection:

          	/**
          	 * Creates a connection consumer for this connection (optional operation)
          	 * on the specific topic using a shared non-durable subscription with
          	 * the specified name.
          	 * <p>
          	 * This is an expert facility not used by ordinary JMS clients.
          	 * <p>
          	 * This method must not be used in a Java EE web or EJB application. Doing
          	 * so may cause a {@code JMSException} to be thrown though this is not
          	 * guaranteed.
          	 * 
          	 * @param topic
          	 *            the topic to access
          	 * @param subscriptionName
          	 *            the name used to identify the shared non-durable subscription
          	 * @param messageSelector
          	 *            only messages with properties matching the message selector
          	 *            expression are delivered. A value of null or an empty string
          	 *            indicates that there is no message selector for the message
          	 *            consumer.
          	 * @param sessionPool
          	 *            the server session pool to associate with this connection
          	 *            consumer
          	 * @param maxMessages
          	 *            the maximum number of messages that can be assigned to a
          	 *            server session at one time
          	 * 
          	 * @return the connection consumer
          	 * 
          	 * @exception InvalidDestinationException
          	 *                if an invalid destination is specified.
          	 * @exception InvalidSelectorException
          	 *                if the message selector is invalid.
          	 * @exception JMSException
          	 *                if the {@code Connection} object fails to create a
          	 *                connection consumer for one of the following reasons:
          	 *                <ul>
          	 *                <li>an internal error has occurred 
          	 *                <li>invalid arguments for {@code sessionPool} and 
          	 *                {@code messageSelector} or 
          	 *                <li>this method has been called in a Java EE web or EJB
          	 *                application (though it is not guaranteed that an exception
          	 *                is thrown in this case)
          	 *                </ul>
          	 * 
          	 * @since 2.0
          	 * @see javax.jms.ConnectionConsumer
          	 */
          	ConnectionConsumer createSharedConnectionConsumer(Topic topic,
          			String subscriptionName,
          			String messageSelector, ServerSessionPool sessionPool,
          			int maxMessages) throws JMSException;
          
          	/**
          	 * Creates a connection consumer for this connection (optional operation)
          	 * on the specific topic using a shared durable subscription with
          	 * the specified name.
          	 * <p>
          	 * This is an expert facility not used by ordinary JMS clients.
          	 * <p>
          	 * This method must not be used in a Java EE web or EJB application. Doing
          	 * so may cause a {@code JMSException} to be thrown though this is not
          	 * guaranteed.
          	 * 
          	 * @param topic
          	 *            topic to access
          	 * @param subscriptionName
          	 *            the name used to identify the shared durable subscription 
          	 * @param messageSelector
          	 *            only messages with properties matching the message selector
          	 *            expression are delivered. A value of null or an empty string
          	 *            indicates that there is no message selector for the message
          	 *            consumer.
          	 * @param sessionPool
          	 *            the server session pool to associate with this durable
          	 *            connection consumer
          	 * @param maxMessages
          	 *            the maximum number of messages that can be assigned to a
          	 *            server session at one time
          	 * 
          	 * @return the durable connection consumer
          	 * 
          	 * @exception InvalidDestinationException
          	 *                if an invalid destination is specified.
          	 * @exception InvalidSelectorException
          	 *                if the message selector is invalid.
          	 * @exception JMSException
          	 *                if the {@code Connection} object fails to create a
          	 *                connection consumer for one of the following reasons:
          	 *                <ul>
          	 *                <li>an internal error has occurred 
          	 *                <li>invalid arguments
          	 *                for {@code sessionPool} and {@code messageSelector} or 
          	 *                <li>this method has been called in a Java EE web or EJB
          	 *                application (though it is not guaranteed that an exception
          	 *                is thrown in this case)
          	 *                </ul>
          	 * @since 2.0
          	 * @see javax.jms.ConnectionConsumer
          	 */
          	ConnectionConsumer createSharedDurableConnectionConsumer(Topic topic, String subscriptionName, String messageSelector,
          			ServerSessionPool sessionPool, int maxMessages) throws JMSException;
          
          Show
          Nigel Deakin added a comment - Here are the proposed new methods on Connection : /** * Creates a connection consumer for this connection (optional operation) * on the specific topic using a shared non-durable subscription with * the specified name. * <p> * This is an expert facility not used by ordinary JMS clients. * <p> * This method must not be used in a Java EE web or EJB application. Doing * so may cause a {@code JMSException} to be thrown though this is not * guaranteed. * * @param topic * the topic to access * @param subscriptionName * the name used to identify the shared non-durable subscription * @param messageSelector * only messages with properties matching the message selector * expression are delivered. A value of null or an empty string * indicates that there is no message selector for the message * consumer. * @param sessionPool * the server session pool to associate with this connection * consumer * @param maxMessages * the maximum number of messages that can be assigned to a * server session at one time * * @return the connection consumer * * @exception InvalidDestinationException * if an invalid destination is specified. * @exception InvalidSelectorException * if the message selector is invalid. * @exception JMSException * if the {@code Connection} object fails to create a * connection consumer for one of the following reasons: * <ul> * <li>an internal error has occurred * <li>invalid arguments for {@code sessionPool} and * {@code messageSelector} or * <li>this method has been called in a Java EE web or EJB * application (though it is not guaranteed that an exception * is thrown in this case) * </ul> * * @since 2.0 * @see javax.jms.ConnectionConsumer */ ConnectionConsumer createSharedConnectionConsumer(Topic topic, String subscriptionName, String messageSelector, ServerSessionPool sessionPool, int maxMessages) throws JMSException; /** * Creates a connection consumer for this connection (optional operation) * on the specific topic using a shared durable subscription with * the specified name. * <p> * This is an expert facility not used by ordinary JMS clients. * <p> * This method must not be used in a Java EE web or EJB application. Doing * so may cause a {@code JMSException} to be thrown though this is not * guaranteed. * * @param topic * topic to access * @param subscriptionName * the name used to identify the shared durable subscription * @param messageSelector * only messages with properties matching the message selector * expression are delivered. A value of null or an empty string * indicates that there is no message selector for the message * consumer. * @param sessionPool * the server session pool to associate with this durable * connection consumer * @param maxMessages * the maximum number of messages that can be assigned to a * server session at one time * * @return the durable connection consumer * * @exception InvalidDestinationException * if an invalid destination is specified. * @exception InvalidSelectorException * if the message selector is invalid. * @exception JMSException * if the {@code Connection} object fails to create a * connection consumer for one of the following reasons: * <ul> * <li>an internal error has occurred * <li>invalid arguments * for {@code sessionPool} and {@code messageSelector} or * <li>this method has been called in a Java EE web or EJB * application (though it is not guaranteed that an exception * is thrown in this case) * </ul> * @since 2.0 * @see javax.jms.ConnectionConsumer */ ConnectionConsumer createSharedDurableConnectionConsumer(Topic topic, String subscriptionName, String messageSelector, ServerSessionPool sessionPool, int maxMessages) throws JMSException;

            People

            • Assignee:
              Nigel Deakin
              Reporter:
              Nigel Deakin
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: