You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@activemq.apache.org by "Justin Bertram (Jira)" <ji...@apache.org> on 2022/09/15 04:47:00 UTC

[jira] [Updated] (ARTEMIS-3639) Introduce ActiveMQServerMessagePlugin::beforeInitialSend

     [ https://issues.apache.org/jira/browse/ARTEMIS-3639?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Justin Bertram updated ARTEMIS-3639:
------------------------------------
    Description: 
Currently ActiveMQServerMessagePlugin::beforeSend could be used to peek initial messages from clients.

Heuristic can cope with detecting if the before send notification by the broker represents an initial message from a client or the notification represents a later forward inside the broker cluster (or network) like a redistribution or a retry after recycling message from DLQ.

The broker should have enough context and it should know explicitly when dealing with an initial client message so the {{ActiveMQServerMessagePlugin}} interface could be improved with:
{code:java}
/**
 * Invoked by the broker before an initial client message is sent (inserted) to the broker.
 * In contrast with {@link #beforeSend} it is not called for subsequent message forwards
 * inside the broker cluster (like redistribution, DLQ recycling, ...). 
 * <p>
 * By default it delegates to {@link #beforeSend}.
 */
default void beforeInitialSend(ServerSession session, Transaction tx, Message message, boolean direct, boolean noAutoCreateQueue) throws ActiveMQException {
   beforeSend(session, tx, message, direct, noAutoCreateQueue);
}{code}


  was:
Currently ActiveMQServerMessagePlugin::beforeSend could be used to peek initial messages from clients.

Heuristic can cope with detecting if the before send notification by the broker represents an initial message from a client or the notification represents a later forward inside the broker cluster (or network) like a redistribution or a retry after recycling message from DLQ.

 

The broker should have enough context and it should know explicitly when dealing with an initial client message so the ActiveMQServerMessagePlugin interface could be improved with:

 

{{  /**}}
{{   * Invoked by the broker before an initial client message is sent (inserted) to the broker.}}
{{   * In contrast with \{@link #beforeSend} it is not called for subsequent message forwards}}
{{   * inside the broker cluster (like redistribution, DLQ recycling, ...). }}
{{   * <p>}}
{{   * By default it delegates to \{@link #beforeSend}.}}
{{   */}}
{{  default void beforeInitialSend(ServerSession session, Transaction tx, Message message, boolean direct, boolean noAutoCreateQueue) throws ActiveMQException {}}
{{     beforeSend(session, tx, message, direct, noAutoCreateQueue);}}
{{  }}}
{{  }}


> Introduce ActiveMQServerMessagePlugin::beforeInitialSend
> --------------------------------------------------------
>
>                 Key: ARTEMIS-3639
>                 URL: https://issues.apache.org/jira/browse/ARTEMIS-3639
>             Project: ActiveMQ Artemis
>          Issue Type: Improvement
>          Components: Broker
>    Affects Versions: 2.20.0
>            Reporter: Petr Kuzel
>            Priority: Minor
>
> Currently ActiveMQServerMessagePlugin::beforeSend could be used to peek initial messages from clients.
> Heuristic can cope with detecting if the before send notification by the broker represents an initial message from a client or the notification represents a later forward inside the broker cluster (or network) like a redistribution or a retry after recycling message from DLQ.
> The broker should have enough context and it should know explicitly when dealing with an initial client message so the {{ActiveMQServerMessagePlugin}} interface could be improved with:
> {code:java}
> /**
>  * Invoked by the broker before an initial client message is sent (inserted) to the broker.
>  * In contrast with {@link #beforeSend} it is not called for subsequent message forwards
>  * inside the broker cluster (like redistribution, DLQ recycling, ...). 
>  * <p>
>  * By default it delegates to {@link #beforeSend}.
>  */
> default void beforeInitialSend(ServerSession session, Transaction tx, Message message, boolean direct, boolean noAutoCreateQueue) throws ActiveMQException {
>    beforeSend(session, tx, message, direct, noAutoCreateQueue);
> }{code}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)