activemq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gemmellr <>
Subject [GitHub] activemq-artemis pull request: ARTEMIS-398 - AMQP protocol idle ti...
Date Mon, 15 Feb 2016 16:58:07 GMT
Github user gemmellr commented on a diff in the pull request:
    --- Diff: artemis-protocols/artemis-proton-plug/src/main/java/org/proton/plug/context/
    @@ -40,28 +44,32 @@
     public abstract class AbstractConnectionContext extends ProtonInitializable implements
AMQPConnectionContext {
    +   public static final Symbol CONNECTION_OPEN_FAILED = Symbol.valueOf("amqp:connection-establishment-failed");
        protected ProtonHandler handler = ProtonHandler.Factory.create();
        protected AMQPConnectionCallback connectionCallback;
    +   private final ScheduledExecutorService scheduledPool;
        private final Map<Session, AbstractProtonSessionContext> sessions = new ConcurrentHashMap<>();
        protected LocalListener listener = new LocalListener();
    -   public AbstractConnectionContext(AMQPConnectionCallback connectionCallback) {
    +   public AbstractConnectionContext(AMQPConnectionCallback connectionCallback, ScheduledExecutorService
scheduledPool) {
        public AbstractConnectionContext(AMQPConnectionCallback connectionCallback,
                                         int idleTimeout,
                                         int maxFrameSize,
    -                                    int channelMax) {
    +                                    int channelMax,
    +                                    ScheduledExecutorService scheduledPool) {
           this.connectionCallback = connectionCallback;
    +      this.scheduledPool = scheduledPool;
           Transport transport = handler.getTransport();
           if (idleTimeout > 0) {
    -         transport.setIdleTimeout(idleTimeout);
    -         transport.tick(idleTimeout / 2);
    +         transport.setIdleTimeout(idleTimeout / 2);
    --- End diff --
    Meant to comment on this before...did you mean to half the value passed here, it wasn't
halved before?
    Proton will half the given value before advertising it to the peer since the AMQP spec
suggests you should advertise half your actual timeout (proton also pessimistically assumes
on the receiving side that the peer did not half it, and so halves it again to ensure it sends
more often than the actual timeout).

If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at or file a JIRA ticket
with INFRA.

View raw message