[GitHub] activemq-artemis pull request #2439: ARTEMIS-2179 mgmnt method to get cluste...

2018-11-20 Thread jbertram
GitHub user jbertram opened a pull request:

https://github.com/apache/activemq-artemis/pull/2439

ARTEMIS-2179 mgmnt method to get cluster-cxn names



You can merge this pull request into a Git repository by running:

$ git pull https://github.com/jbertram/activemq-artemis ARTEMIS-2179

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/activemq-artemis/pull/2439.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 #2439


commit 355f4fadeb477fece8ddb3d062a7c914b132a669
Author: Justin Bertram 
Date:   2018-11-21T00:53:01Z

ARTEMIS-2179 mgmnt method to get cluster-cxn names




---


[GitHub] activemq-artemis pull request #2438: ARTEMIS-2178 routing-type config for co...

2018-11-20 Thread jbertram
GitHub user jbertram opened a pull request:

https://github.com/apache/activemq-artemis/pull/2438

ARTEMIS-2178 routing-type config for core bridge

MULTICAST messages forwarded by a core bridge will not be routed to any
ANYCAST queues and vice-versa. Diverts have the ability to configure how
routing-type is treated. Core bridges now support this same kind of
functionality. By default the bridge does not alter the routing-type of
forwarded messages to maintain compatibility with existing behavior.

You can merge this pull request into a Git repository by running:

$ git pull https://github.com/jbertram/activemq-artemis ARTEMIS-2178

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/activemq-artemis/pull/2438.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 #2438


commit 1ae5db1432a56489162b36297f902cbaf5b84e38
Author: Justin Bertram 
Date:   2018-11-20T03:24:35Z

ARTEMIS-2178 routing-type config for core bridge

MULTICAST messages forwarded by a core bridge will not be routed to any
ANYCAST queues and vice-versa. Diverts have the ability to configure how
routing-type is treated. Core bridges now support this same kind of
functionality. By default the bridge does not alter the routing-type of
forwarded messages to maintain compatibility with existing behavior.




---


[GitHub] activemq-artemis pull request #2427: ARTEMIS-2170 Optimized CoreMessage's ch...

2018-11-20 Thread michaelandrepearce
Github user michaelandrepearce commented on a diff in the pull request:

https://github.com/apache/activemq-artemis/pull/2427#discussion_r235089654
  
--- Diff: 
artemis-core-client/src/main/java/org/apache/activemq/artemis/core/message/impl/CoreMessage.java
 ---
@@ -52,6 +52,11 @@
  *  consumers */
 public class CoreMessage extends RefCountMessage implements ICoreMessage {
 
+   // We use properties to establish routing context on clustering.
+   // However if the client resends the message after receiving, it needs 
to be removed
+   private static final Predicate 
INTERNAL_PROPERTY_NAMES_CLEANUP_FILTER =
--- End diff --

You'd be better asking people like martyn or clebert to confirm. But the 
looks of it there seems some streamlining to be done.


---


[GitHub] activemq-artemis issue #2287: ARTEMIS-2069 Backup doesn't activate after sha...

2018-11-20 Thread TomasHofman
Github user TomasHofman commented on the issue:

https://github.com/apache/activemq-artemis/pull/2287
  
@jbertram @franz1981 we could really use this...


---


[GitHub] activemq-artemis pull request #2427: ARTEMIS-2170 Optimized CoreMessage's ch...

2018-11-20 Thread franz1981
Github user franz1981 commented on a diff in the pull request:

https://github.com/apache/activemq-artemis/pull/2427#discussion_r234941860
  
--- Diff: 
artemis-core-client/src/main/java/org/apache/activemq/artemis/core/message/impl/CoreMessage.java
 ---
@@ -52,6 +52,11 @@
  *  consumers */
 public class CoreMessage extends RefCountMessage implements ICoreMessage {
 
+   // We use properties to establish routing context on clustering.
+   // However if the client resends the message after receiving, it needs 
to be removed
+   private static final Predicate 
INTERNAL_PROPERTY_NAMES_CLEANUP_FILTER =
--- End diff --

Good catch!
I'm looking from the tablet so I hope to have searched all the interesting 
points, but it seems to me that HDR_ROUTE_TO_ACK_IDS is not needed anymore? Or 
am I missing anything?
`Message.HDR_ROUTE_TO_IDS.concat(bridgeName);` is using HDR_ROUTE_TO_IDS in 
a way that it will match the `CoreMessage::cleanupInternalProperties` cases, 
but for HDR_ROUTE_TO_ACK_IDS I can't see any points doing anything similar: 
just using the entire property name ie it won't match the  
`CoreMessage::cleanupInternalProperties` checks.


---


[GitHub] activemq-artemis pull request #2427: ARTEMIS-2170 Optimized CoreMessage's ch...

2018-11-20 Thread michaelandrepearce
Github user michaelandrepearce commented on a diff in the pull request:

https://github.com/apache/activemq-artemis/pull/2427#discussion_r234926580
  
--- Diff: 
artemis-core-client/src/main/java/org/apache/activemq/artemis/core/message/impl/CoreMessage.java
 ---
@@ -578,34 +567,41 @@ public CoreMessage setUserID(UUID userID) {
/**
 * I am keeping this synchronized as the decode of the Properties is 
lazy
 */
-   protected TypedProperties checkProperties() {
+   protected final TypedProperties getOrCreateProperties() {
--- End diff --

All it does it invoke / delegate this method, as such if anything i see 
naming CoreMessage.getProperties cleaner. And there is no need to change it 
from final, simply you remove the impl in ClientMessageInternalImpl as it would 
just inherit.

```
   public TypedProperties getProperties() {
  return this.checkProperties();
   }
```


---


[GitHub] activemq-artemis pull request #2427: ARTEMIS-2170 Optimized CoreMessage's ch...

2018-11-20 Thread michaelandrepearce
Github user michaelandrepearce commented on a diff in the pull request:

https://github.com/apache/activemq-artemis/pull/2427#discussion_r234909113
  
--- Diff: 
artemis-core-client/src/main/java/org/apache/activemq/artemis/core/message/impl/CoreMessage.java
 ---
@@ -52,6 +52,11 @@
  *  consumers */
 public class CoreMessage extends RefCountMessage implements ICoreMessage {
 
+   // We use properties to establish routing context on clustering.
+   // However if the client resends the message after receiving, it needs 
to be removed
+   private static final Predicate 
INTERNAL_PROPERTY_NAMES_CLEANUP_FILTER =
--- End diff --

@franz1981 in RemoteQueueBindingImpl.addRouteContextToMessage these are 
added as extraByteProperties, and used in ClusterConnectionBridge maybe a 
simpler solution is to hold extraByteProperties in a separate TypeProperties 
like in AMQPMessage, then its easy to strip these extra internal properties (no 
need to even iterate) / not let it leak to clients, just as in AMQPMessage.


---


[GitHub] activemq-artemis pull request #2427: ARTEMIS-2170 Optimized CoreMessage's ch...

2018-11-20 Thread franz1981
Github user franz1981 commented on a diff in the pull request:

https://github.com/apache/activemq-artemis/pull/2427#discussion_r234906424
  
--- Diff: 
artemis-core-client/src/main/java/org/apache/activemq/artemis/core/message/impl/CoreMessage.java
 ---
@@ -578,34 +567,41 @@ public CoreMessage setUserID(UUID userID) {
/**
 * I am keeping this synchronized as the decode of the Properties is 
lazy
 */
-   protected TypedProperties checkProperties() {
+   protected final TypedProperties getOrCreateProperties() {
--- End diff --

The reason why I haven't done it is due to `ClientMessageImpl extends 
CoreMessage implements ClientMessageInternal`: `ClientMessageInternal` has 
already a `geProperties` method while `CoreMessage::getProperties` has been 
turned into final...
I can drop the final just to have a better name, but I would prefer to keep 
it final to avoid any child of `CoreMessage` to broke its thread-safeness 
contract by overriding it.


---


[GitHub] activemq-artemis pull request #2427: ARTEMIS-2170 Optimized CoreMessage's ch...

2018-11-20 Thread michaelandrepearce
Github user michaelandrepearce commented on a diff in the pull request:

https://github.com/apache/activemq-artemis/pull/2427#discussion_r234903527
  
--- Diff: 
artemis-core-client/src/main/java/org/apache/activemq/artemis/core/message/impl/CoreMessage.java
 ---
@@ -803,139 +799,122 @@ public CoreMessage setDurable(boolean durable) {
@Override
public CoreMessage putBooleanProperty(final String key, final boolean 
value) {
   messageChanged();
-  checkProperties();
-  properties.putBooleanProperty(SimpleString.toSimpleString(key, 
getPropertyKeysPool()), value);
+  getOrCreateProperties().putBooleanProperty(key(key), value);
   return this;
}
 
@Override
public CoreMessage putBooleanProperty(final SimpleString key, final 
boolean value) {
   messageChanged();
-  checkProperties();
-  properties.putBooleanProperty(key, value);
+  getOrCreateProperties().putBooleanProperty(key, value);
   return this;
}
 
@Override
public Boolean getBooleanProperty(final SimpleString key) throws 
ActiveMQPropertyConversionException {
-  checkProperties();
-  return properties.getBooleanProperty(key);
+  return getOrCreateProperties().getBooleanProperty(key);
}
 
@Override
public Boolean getBooleanProperty(final String key) throws 
ActiveMQPropertyConversionException {
-  checkProperties();
-  return 
properties.getBooleanProperty(SimpleString.toSimpleString(key, 
getPropertyKeysPool()));
+  return getOrCreateProperties().getBooleanProperty(key(key));
}
 
@Override
public CoreMessage putByteProperty(final SimpleString key, final byte 
value) {
   messageChanged();
-  checkProperties();
-  properties.putByteProperty(key, value);
+  getOrCreateProperties().putByteProperty(key, value);
   return this;
}
 
@Override
public CoreMessage putByteProperty(final String key, final byte value) {
   messageChanged();
-  checkProperties();
-  properties.putByteProperty(SimpleString.toSimpleString(key, 
getPropertyKeysPool()), value);
+  getOrCreateProperties().putByteProperty(key(key), value);
 
   return this;
}
 
@Override
public Byte getByteProperty(final SimpleString key) throws 
ActiveMQPropertyConversionException {
-  checkProperties();
-  return properties.getByteProperty(key);
+  return getOrCreateProperties().getByteProperty(key);
}
 
@Override
public Byte getByteProperty(final String key) throws 
ActiveMQPropertyConversionException {
-  return getByteProperty(SimpleString.toSimpleString(key, 
getPropertyKeysPool()));
+  return getByteProperty(key(key));
}
 
@Override
public CoreMessage putBytesProperty(final SimpleString key, final 
byte[] value) {
   messageChanged();
-  checkProperties();
-  properties.putBytesProperty(key, value);
+  getOrCreateProperties().putBytesProperty(key, value);
 
   return this;
}
 
@Override
public CoreMessage putBytesProperty(final String key, final byte[] 
value) {
   messageChanged();
-  checkProperties();
-  properties.putBytesProperty(SimpleString.toSimpleString(key, 
getPropertyKeysPool()), value);
+  getOrCreateProperties().putBytesProperty(key(key), value);
   return this;
}
 
@Override
public byte[] getBytesProperty(final SimpleString key) throws 
ActiveMQPropertyConversionException {
-  checkProperties();
-  return properties.getBytesProperty(key);
+  return getOrCreateProperties().getBytesProperty(key);
}
 
@Override
public byte[] getBytesProperty(final String key) throws 
ActiveMQPropertyConversionException {
-  return getBytesProperty(SimpleString.toSimpleString(key, 
getPropertyKeysPool()));
+  return getBytesProperty(key(key));
}
 
@Override
public CoreMessage putCharProperty(SimpleString key, char value) {
   messageChanged();
-  checkProperties();
-  properties.putCharProperty(key, value);
+  getOrCreateProperties().putCharProperty(key, value);
   return this;
}
 
@Override
public CoreMessage putCharProperty(String key, char value) {
   messageChanged();
-  checkProperties();
-  properties.putCharProperty(SimpleString.toSimpleString(key, 
getPropertyKeysPool()), value);
+  getOrCreateProperties().putCharProperty(key(key), value);
--- End diff --

+1


---