You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@activemq.apache.org by bayern39 <gi...@git.apache.org> on 2016/07/27 07:16:44 UTC
[GitHub] activemq-artemis pull request #672: [ARTEMIS-642] Disable slow client reconn...
GitHub user bayern39 opened a pull request:
https://github.com/apache/activemq-artemis/pull/672
[ARTEMIS-642] Disable slow client reconnecting with KILL slow client policy
https://issues.apache.org/jira/browse/ARTEMIS-642
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/bayern39/activemq-artemis kill_slow_client
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/activemq-artemis/pull/672.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #672
----
commit 3ad7f08597e7e4dee6f348d1d4b76776b37c5ce9
Author: bayern39 <mc...@redhat.com>
Date: 2016-07-15T07:33:42Z
[ARTEMIS-642] Disable slow client reconnecting with KILL slow client policy
----
---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] activemq-artemis pull request #672: [ARTEMIS-642] Disable slow client reconn...
Posted by johnament <gi...@git.apache.org>.
Github user johnament commented on a diff in the pull request:
https://github.com/apache/activemq-artemis/pull/672#discussion_r72964880
--- Diff: artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/RemotingConnectionImpl.java ---
@@ -387,4 +388,15 @@ public void setClientID(String cID) {
public String getClientID() {
return clientID;
}
+
+ @Override
+ public void killMessage(SimpleString nodeID) throws Exception {
+ if (clientVersion < DisconnectConsumerWithKillMessage.VERSION_INTRODUCED) {
+ throw new Exception(String.valueOf(clientVersion));
--- End diff --
Can this be a more specific ActiveMQ Exception? Even if its just `ActiveMQException`
---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] activemq-artemis issue #672: [ARTEMIS-642] Disable slow client reconnecting ...
Posted by bayern39 <gi...@git.apache.org>.
Github user bayern39 commented on the issue:
https://github.com/apache/activemq-artemis/pull/672
@clebertsuconic I have done it !
---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] activemq-artemis pull request #672: [ARTEMIS-642] Disable slow client reconn...
Posted by johnament <gi...@git.apache.org>.
Github user johnament commented on a diff in the pull request:
https://github.com/apache/activemq-artemis/pull/672#discussion_r72421069
--- Diff: artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/QueueImpl.java ---
@@ -2983,6 +2988,18 @@ else if (consumerRate < threshold) {
if (connection != null) {
ActiveMQServerLogger.LOGGER.slowConsumerDetected(serverConsumer.getSessionID(), serverConsumer.getID(), getName().toString(), connection.getRemoteAddress(), threshold, consumerRate);
if (policy.equals(SlowConsumerPolicy.KILL)) {
+ if (connection instanceof CoreRemotingConnection) {
+ CoreRemotingConnection coreconnection = (CoreRemotingConnection)connection;
+
+ Channel channel1 = coreconnection.getChannel(1, -1);
--- End diff --
maybe `clientChannel` or something similar? `channel1` doesn't give much description.
---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] activemq-artemis issue #672: [ARTEMIS-642] Disable slow client reconnecting ...
Posted by clebertsuconic <gi...@git.apache.org>.
Github user clebertsuconic commented on the issue:
https://github.com/apache/activemq-artemis/pull/672
The tests are all ok.
I will do one final review tomorrow, but it looks good to merge. nice job!
---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] activemq-artemis pull request #672: [ARTEMIS-642] Disable slow client reconn...
Posted by johnament <gi...@git.apache.org>.
Github user johnament commented on a diff in the pull request:
https://github.com/apache/activemq-artemis/pull/672#discussion_r72686692
--- Diff: artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/ActiveMQSessionContext.java ---
@@ -759,6 +769,12 @@ protected void handleReceiveProducerFailCredits(SessionProducerCreditsFailMessag
handleReceiveProducerFailCredits(message.getAddress(), message.getCredits());
}
+ protected void handleReceiveSlowConsumerKillMessage(DisconnectConsumerWithKillMessage message) {
+ if (message.getNodeID() != null) {
+ setKilled(true);
--- End diff --
since its always called with true, would it make sense to have a `kill()` method instead?
---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] activemq-artemis issue #672: [ARTEMIS-642] Disable slow client reconnecting ...
Posted by bayern39 <gi...@git.apache.org>.
Github user bayern39 commented on the issue:
https://github.com/apache/activemq-artemis/pull/672
@johnament Thanks ,John,I will fix the mistake.The last one you have sayed,I do't understand it?The client judge the message type and decide the next step, it has been done.
---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] activemq-artemis pull request #672: [ARTEMIS-642] Disable slow client reconn...
Posted by clebertsuconic <gi...@git.apache.org>.
Github user clebertsuconic commented on a diff in the pull request:
https://github.com/apache/activemq-artemis/pull/672#discussion_r72982711
--- Diff: artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/RemotingConnectionImpl.java ---
@@ -387,4 +388,15 @@ public void setClientID(String cID) {
public String getClientID() {
return clientID;
}
+
+ @Override
+ public void killMessage(SimpleString nodeID) throws ActiveMQException {
+ if (clientVersion < DisconnectConsumerWithKillMessage.VERSION_INTRODUCED) {
+ throw new ActiveMQException(String.valueOf(clientVersion));
--- End diff --
do not throw anything.. simply ignore it and close the client accordingly. no semantic change should be made
---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] activemq-artemis pull request #672: [ARTEMIS-642] Disable slow client reconn...
Posted by johnament <gi...@git.apache.org>.
Github user johnament commented on a diff in the pull request:
https://github.com/apache/activemq-artemis/pull/672#discussion_r72686789
--- Diff: artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/RemotingConnectionImpl.java ---
@@ -387,4 +389,15 @@ public void setClientID(String cID) {
public String getClientID() {
return clientID;
}
+
+ @Override
+ public void sentKilledMessage(SimpleString nodeID, Version version) throws Exception {
--- End diff --
should probably be `sendKillMessage`?
---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] activemq-artemis pull request #672: [ARTEMIS-642] Disable slow client reconn...
Posted by clebertsuconic <gi...@git.apache.org>.
Github user clebertsuconic commented on a diff in the pull request:
https://github.com/apache/activemq-artemis/pull/672#discussion_r72517417
--- Diff: artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/QueueImpl.java ---
@@ -2983,6 +2988,18 @@ else if (consumerRate < threshold) {
if (connection != null) {
ActiveMQServerLogger.LOGGER.slowConsumerDetected(serverConsumer.getSessionID(), serverConsumer.getID(), getName().toString(), connection.getRemoteAddress(), threshold, consumerRate);
if (policy.equals(SlowConsumerPolicy.KILL)) {
+ if (connection instanceof CoreRemotingConnection) {
--- End diff --
This should be abstract through the ProtocolManagers somehow. You can't do a protocol specific implementation on QueueImpl.
---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] activemq-artemis issue #672: [ARTEMIS-642] Disable slow client reconnecting ...
Posted by bayern39 <gi...@git.apache.org>.
Github user bayern39 commented on the issue:
https://github.com/apache/activemq-artemis/pull/672
@clebertsuconic Hi Clebert\uff0cI know how to get client version,but i do not know how to get supported version\uff0ccan you tell me more detail\uff1fThanks
---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] activemq-artemis issue #672: [ARTEMIS-642] Disable slow client reconnecting ...
Posted by johnament <gi...@git.apache.org>.
Github user johnament commented on the issue:
https://github.com/apache/activemq-artemis/pull/672
BTW, you may want to look at the jenkins output. May be a new test failing.
---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] activemq-artemis issue #672: [ARTEMIS-642] Disable slow client reconnecting ...
Posted by bayern39 <gi...@git.apache.org>.
Github user bayern39 commented on the issue:
https://github.com/apache/activemq-artemis/pull/672
@clebertsuconic Hi,Clebert,I have committed a new,I have done as you say, add a check of version ID and don't store the sessionContexts,but the last you sayed "rough the ProtocolManagers somehow",I try to do it,but it maybe inconvenient and difficult, so in order to not do a protocol specific implementation on QueueImpl,I have add a new method in the Interface of RemotingConnection,this is my solution,what do you think about it?
---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] activemq-artemis issue #672: [ARTEMIS-642] Disable slow client reconnecting ...
Posted by johnament <gi...@git.apache.org>.
Github user johnament commented on the issue:
https://github.com/apache/activemq-artemis/pull/672
@bayern39 sorry, you're right. I just realized your changes in `failoverOrReconnect` is in the client side.
---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] activemq-artemis issue #672: [ARTEMIS-642] Disable slow client reconnecting ...
Posted by bayern39 <gi...@git.apache.org>.
Github user bayern39 commented on the issue:
https://github.com/apache/activemq-artemis/pull/672
@johnament yeah,I have seen the output,but when I run the new single test on my local machine,it is not wrong.I will run it more times.
---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] activemq-artemis pull request #672: [ARTEMIS-642] Disable slow client reconn...
Posted by clebertsuconic <gi...@git.apache.org>.
Github user clebertsuconic commented on a diff in the pull request:
https://github.com/apache/activemq-artemis/pull/672#discussion_r72516322
--- Diff: artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/DisconnectConsumerWithKillMessage.java ---
@@ -0,0 +1,58 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.activemq.artemis.core.protocol.core.impl.wireformat;
+
+import org.apache.activemq.artemis.api.core.ActiveMQBuffer;
+import org.apache.activemq.artemis.api.core.SimpleString;
+import org.apache.activemq.artemis.core.protocol.core.impl.PacketImpl;
+
+public class DisconnectConsumerWithKillMessage extends PacketImpl {
+
+ private SimpleString nodeID;
+
+ public DisconnectConsumerWithKillMessage(final SimpleString nodeID) {
+ super(DISCONNECT_CONSUMER_KILL);
+ this.nodeID = nodeID;
+ }
+
+ public DisconnectConsumerWithKillMessage() {
--- End diff --
I think al lthe Protocol types have it
---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] activemq-artemis issue #672: [ARTEMIS-642] Disable slow client reconnecting ...
Posted by clebertsuconic <gi...@git.apache.org>.
Github user clebertsuconic commented on the issue:
https://github.com/apache/activemq-artemis/pull/672
This is much better... now the only thing wrong is the versioning.
There's no need to add any fields. When the client connects to the server it will set the versionID when the session is created.
You just need to increase the versionID. Check if the client.version is >= the supported version (You will need to create some constant for that on the Packet.. liker version created or so)... and only send the kill if the client understands this command.
This is important not only for legacy support, but even to support 1.0, 1.1, 1.2 and 1.3 when we release 1.4+.
---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] activemq-artemis pull request #672: [ARTEMIS-642] Disable slow client reconn...
Posted by johnament <gi...@git.apache.org>.
Github user johnament commented on a diff in the pull request:
https://github.com/apache/activemq-artemis/pull/672#discussion_r72420571
--- Diff: tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/SlowConsumerTest.java ---
@@ -115,6 +119,40 @@ public void testSlowConsumerKilled() throws Exception {
}
@Test
+ public void testDisableSlowConsumerReconnectWithKilled() throws Exception {
+ ClientSessionFactory sf = createSessionFactory(locator);
+
+ ClientSession session = addClientSession(sf.createSession(false, true, true, false));
+
+ session.createQueue(QUEUE, QUEUE, null, false);
+
+ ClientProducer producer = addClientProducer(session.createProducer(QUEUE));
+
+ final int numMessages = 25;
+
+ for (int i = 0; i < numMessages; i++) {
+ producer.send(createTextMessage(session, "m" + i));
+ }
+
+ ClientConsumer consumer = addClientConsumer(session.createConsumer(QUEUE));
+ session.start();
+
+ Thread.sleep(3000);
+
+ RemotingService service = server.getRemotingService();
+ Set<RemotingConnection> connections = service.getConnections();
+ assertEquals(true, connections.isEmpty());
--- End diff --
maybe `assertTrue` instead?
---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] activemq-artemis pull request #672: [ARTEMIS-642] Disable slow client reconn...
Posted by clebertsuconic <gi...@git.apache.org>.
Github user clebertsuconic commented on a diff in the pull request:
https://github.com/apache/activemq-artemis/pull/672#discussion_r72704599
--- Diff: artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/RemotingConnectionImpl.java ---
@@ -387,4 +389,15 @@ public void setClientID(String cID) {
public String getClientID() {
return clientID;
}
+
+ @Override
+ public void sentKilledMessage(SimpleString nodeID, Version version) throws Exception {
--- End diff --
or just killMessage()... sent is the past... definitely not sent
---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] activemq-artemis issue #672: [ARTEMIS-642] Disable slow client reconnecting ...
Posted by clebertsuconic <gi...@git.apache.org>.
Github user clebertsuconic commented on the issue:
https://github.com/apache/activemq-artemis/pull/672
I don't think we can merge this...
this is introducing a new datatype through the protocol and it will break compatibility with older clients in both directions. You would need to add handchecks for the version ID on the protocol if that's possible or not.
I wouldn't do a hashMap storing sessions. I would just disable reconnections or kill all the sessions.
---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] activemq-artemis pull request #672: [ARTEMIS-642] Disable slow client reconn...
Posted by johnament <gi...@git.apache.org>.
Github user johnament commented on a diff in the pull request:
https://github.com/apache/activemq-artemis/pull/672#discussion_r72964784
--- Diff: artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/ActiveMQSessionContext.java ---
@@ -162,6 +164,14 @@ public int getReconnectID() {
return sessionChannel.getReconnectID();
}
+ public boolean isKilled() {
+ return killed;
+ }
+
+ public void kill(boolean killed) {
--- End diff --
Sorry, I wasn't clear. When I mentioned `kill()` I was thinking:
```
public void kill() {
this.killed = true;
}
```
This way the caller isn't directly modifying the variable. But no big deal.
---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] activemq-artemis issue #672: [ARTEMIS-642] Disable slow client reconnecting ...
Posted by clebertsuconic <gi...@git.apache.org>.
Github user clebertsuconic commented on the issue:
https://github.com/apache/activemq-artemis/pull/672
I will run tests and merge this tomorrow.
---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] activemq-artemis issue #672: [ARTEMIS-642] Disable slow client reconnecting ...
Posted by bayern39 <gi...@git.apache.org>.
Github user bayern39 commented on the issue:
https://github.com/apache/activemq-artemis/pull/672
@johnament @clebertsuconic Hi,I have fixed the mistake!Thanks!
---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] activemq-artemis issue #672: [ARTEMIS-642] Disable slow client reconnecting ...
Posted by clebertsuconic <gi...@git.apache.org>.
Github user clebertsuconic commented on the issue:
https://github.com/apache/activemq-artemis/pull/672
This is actually well put together now.. merging it.
---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] activemq-artemis pull request #672: [ARTEMIS-642] Disable slow client reconn...
Posted by johnament <gi...@git.apache.org>.
Github user johnament commented on a diff in the pull request:
https://github.com/apache/activemq-artemis/pull/672#discussion_r72420954
--- Diff: artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/QueueImpl.java ---
@@ -2971,6 +2975,7 @@ public void run() {
else if (consumerRate < threshold) {
RemotingConnection connection = null;
RemotingService remotingService = ((PostOfficeImpl) postOffice).getServer().getRemotingService();
+ ActiveMQServer server = ((PostOfficeImpl) postOffice).getServer();
--- End diff --
The code now casts twice. Should this be in the interface? Should the casting be done once? Can server be extracted for the line above?
---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] activemq-artemis pull request #672: [ARTEMIS-642] Disable slow client reconn...
Posted by johnament <gi...@git.apache.org>.
Github user johnament commented on a diff in the pull request:
https://github.com/apache/activemq-artemis/pull/672#discussion_r72421190
--- Diff: artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/DisconnectConsumerWithKillMessage.java ---
@@ -0,0 +1,58 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.activemq.artemis.core.protocol.core.impl.wireformat;
+
+import org.apache.activemq.artemis.api.core.ActiveMQBuffer;
+import org.apache.activemq.artemis.api.core.SimpleString;
+import org.apache.activemq.artemis.core.protocol.core.impl.PacketImpl;
+
+public class DisconnectConsumerWithKillMessage extends PacketImpl {
+
+ private SimpleString nodeID;
+
+ public DisconnectConsumerWithKillMessage(final SimpleString nodeID) {
+ super(DISCONNECT_CONSUMER_KILL);
+ this.nodeID = nodeID;
+ }
+
+ public DisconnectConsumerWithKillMessage() {
--- End diff --
Is this constructor needed? If not, then the field can be final.
---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] activemq-artemis issue #672: [ARTEMIS-642] Disable slow client reconnecting ...
Posted by clebertsuconic <gi...@git.apache.org>.
Github user clebertsuconic commented on the issue:
https://github.com/apache/activemq-artemis/pull/672
Change activemq.version.incrementingVersion.. add 128 there...
on activemq-version.properties.. add 128 to the compatibleVersionList also...
When you are about to send the packet from CoreRemotingConenction... send the packet only if version >= 128.. make a constant on the packet for VERSION_INTRODUCED.. or something like that.
---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] activemq-artemis issue #672: [ARTEMIS-642] Disable slow client reconnecting ...
Posted by johnament <gi...@git.apache.org>.
Github user johnament commented on the issue:
https://github.com/apache/activemq-artemis/pull/672
@clebertsuconic think we can add the version aware stuff to the hacking guide? Would be useful for those not very familiar to know how to deal with it.
---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] activemq-artemis issue #672: [ARTEMIS-642] Disable slow client reconnecting ...
Posted by bayern39 <gi...@git.apache.org>.
Github user bayern39 commented on the issue:
https://github.com/apache/activemq-artemis/pull/672
@johnament I have fixed the mistake!
---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] activemq-artemis pull request #672: [ARTEMIS-642] Disable slow client reconn...
Posted by clebertsuconic <gi...@git.apache.org>.
Github user clebertsuconic commented on a diff in the pull request:
https://github.com/apache/activemq-artemis/pull/672#discussion_r72516104
--- Diff: tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/SlowConsumerTest.java ---
@@ -115,6 +119,40 @@ public void testSlowConsumerKilled() throws Exception {
}
@Test
+ public void testDisableSlowConsumerReconnectWithKilled() throws Exception {
+ ClientSessionFactory sf = createSessionFactory(locator);
+
+ ClientSession session = addClientSession(sf.createSession(false, true, true, false));
+
+ session.createQueue(QUEUE, QUEUE, null, false);
+
+ ClientProducer producer = addClientProducer(session.createProducer(QUEUE));
+
+ final int numMessages = 25;
+
+ for (int i = 0; i < numMessages; i++) {
+ producer.send(createTextMessage(session, "m" + i));
+ }
+
+ ClientConsumer consumer = addClientConsumer(session.createConsumer(QUEUE));
+ session.start();
+
+ Thread.sleep(3000);
+
+ RemotingService service = server.getRemotingService();
+ Set<RemotingConnection> connections = service.getConnections();
+ assertEquals(true, connections.isEmpty());
--- End diff --
+1 Assert.assertTrue is better here
---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] activemq-artemis issue #672: [ARTEMIS-642] Disable slow client reconnecting ...
Posted by johnament <gi...@git.apache.org>.
Github user johnament commented on the issue:
https://github.com/apache/activemq-artemis/pull/672
Looks good to me.
---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] activemq-artemis issue #672: [ARTEMIS-642] Disable slow client reconnecting ...
Posted by bayern39 <gi...@git.apache.org>.
Github user bayern39 commented on the issue:
https://github.com/apache/activemq-artemis/pull/672
@johnament OK,I have done it!
---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] activemq-artemis pull request #672: [ARTEMIS-642] Disable slow client reconn...
Posted by johnament <gi...@git.apache.org>.
Github user johnament commented on a diff in the pull request:
https://github.com/apache/activemq-artemis/pull/672#discussion_r72420605
--- Diff: tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/SlowConsumerTest.java ---
@@ -115,6 +119,40 @@ public void testSlowConsumerKilled() throws Exception {
}
@Test
+ public void testDisableSlowConsumerReconnectWithKilled() throws Exception {
+ ClientSessionFactory sf = createSessionFactory(locator);
+
+ ClientSession session = addClientSession(sf.createSession(false, true, true, false));
+
+ session.createQueue(QUEUE, QUEUE, null, false);
+
+ ClientProducer producer = addClientProducer(session.createProducer(QUEUE));
+
+ final int numMessages = 25;
+
+ for (int i = 0; i < numMessages; i++) {
+ producer.send(createTextMessage(session, "m" + i));
+ }
+
+ ClientConsumer consumer = addClientConsumer(session.createConsumer(QUEUE));
+ session.start();
+
+ Thread.sleep(3000);
+
+ RemotingService service = server.getRemotingService();
+ Set<RemotingConnection> connections = service.getConnections();
+ assertEquals(true, connections.isEmpty());
+
+ if (sf instanceof ClientSessionFactoryImpl) {
+ int reconnectAttemps = ((ClientSessionFactoryImpl)sf).getReconnectAttempts();
+ assertEquals(0, reconnectAttemps);
+ }
+ else {
+ throw new ActiveMQException();
--- End diff --
why not `fail()` with the reason?
---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] activemq-artemis pull request #672: [ARTEMIS-642] Disable slow client reconn...
Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:
https://github.com/apache/activemq-artemis/pull/672
---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] activemq-artemis issue #672: [ARTEMIS-642] Disable slow client reconnecting ...
Posted by johnament <gi...@git.apache.org>.
Github user johnament commented on the issue:
https://github.com/apache/activemq-artemis/pull/672
It strikes me that the client needs to know about this message type as well, potentially.
---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---