[jira] [Commented] (ARTEMIS-1874) NPE in ActiveMQMessage.setObjectProperty

2018-09-28 Thread ASF GitHub Bot (JIRA)


[ 
https://issues.apache.org/jira/browse/ARTEMIS-1874?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16632251#comment-16632251
 ] 

ASF GitHub Bot commented on ARTEMIS-1874:
-

Github user asfgit closed the pull request at:

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


> NPE in ActiveMQMessage.setObjectProperty
> 
>
> Key: ARTEMIS-1874
> URL: https://issues.apache.org/jira/browse/ARTEMIS-1874
> Project: ActiveMQ Artemis
>  Issue Type: Bug
>Affects Versions: 2.6.0
>Reporter: Alastair Mailer
>Assignee: Justin Bertram
>Priority: Critical
> Fix For: 2.6.1, 2.7.0
>
>
> Calling ActiveMQMessage.setObjectProperty("name", null) causes an NPE in 
> handleCoreProperty line 968 (value.toString()) if "name" is either 
> "JMSXGroupID" or "JMSXUserID".



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (ARTEMIS-1874) NPE in ActiveMQMessage.setObjectProperty

2018-09-28 Thread ASF subversion and git services (JIRA)


[ 
https://issues.apache.org/jira/browse/ARTEMIS-1874?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16632250#comment-16632250
 ] 

ASF subversion and git services commented on ARTEMIS-1874:
--

Commit 11ce7f864e861c98eaa1b582195273cdde67d86b in activemq-artemis's branch 
refs/heads/1.x from [~jbertram]
[ https://git-wip-us.apache.org/repos/asf?p=activemq-artemis.git;h=11ce7f8 ]

ARTEMIS-1874 fix NPE setting object property

(cherry picked from commit 4d492bea0ee5fb00dcceca9366375cb87d32fe94)


> NPE in ActiveMQMessage.setObjectProperty
> 
>
> Key: ARTEMIS-1874
> URL: https://issues.apache.org/jira/browse/ARTEMIS-1874
> Project: ActiveMQ Artemis
>  Issue Type: Bug
>Affects Versions: 2.6.0
>Reporter: Alastair Mailer
>Assignee: Justin Bertram
>Priority: Critical
> Fix For: 2.6.1, 2.7.0
>
>
> Calling ActiveMQMessage.setObjectProperty("name", null) causes an NPE in 
> handleCoreProperty line 968 (value.toString()) if "name" is either 
> "JMSXGroupID" or "JMSXUserID".



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (ARTEMIS-1980) Warn on failed check of table existence should be info

2018-09-28 Thread ASF GitHub Bot (JIRA)


[ 
https://issues.apache.org/jira/browse/ARTEMIS-1980?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16632215#comment-16632215
 ] 

ASF GitHub Bot commented on ARTEMIS-1980:
-

Github user clebertsuconic commented on a diff in the pull request:

https://github.com/apache/activemq-artemis/pull/2181#discussion_r221341953
  
--- Diff: 
artemis-jdbc-store/src/main/java/org/apache/activemq/artemis/jdbc/store/drivers/AbstractJDBCDriver.java
 ---
@@ -227,7 +227,11 @@ private void createTableIfNotExists(String tableName, 
String... sqls) throws SQL
   }
}
 } catch (SQLException e) {
-   logger.warn(JDBCUtils.appendSQLExceptionDetails(new 
StringBuilder("Can't verify the initialization of table 
").append(tableName).append(" due to:"), e, 
sqlProvider.getCountJournalRecordsSQL()));
+   if (logger.isDebugEnabled()) {
--- End diff --

the if (logger.isDebugEnable()) is meant to avoid sending something to 
debug and have it ignored.


you have two options:

either:
```java
if (logger.isDebugEnabled()) { 
  logger.debug();
}
```


or


```java
 logger.infof (...);
```


keep it simple... mixing it like that may confuse debugging and the user In 
my experience.


> Warn on failed check of table existence should be info
> --
>
> Key: ARTEMIS-1980
> URL: https://issues.apache.org/jira/browse/ARTEMIS-1980
> Project: ActiveMQ Artemis
>  Issue Type: Improvement
>  Components: Broker
>Affects Versions: 2.6.2
>Reporter: Francesco Nigro
>Assignee: Francesco Nigro
>Priority: Trivial
> Fix For: 2.7.0
>
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> DB2 metadata checks should erroneously report stale table existence on
> not existing/just deleted table, making the subsequent warning logs of failed
> SELECT COUNT useless and scaring: should be better to let them lowered to 
> INFO level, avoiding users log reporting tools (if any) to react to an 
> expected behaviour.
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (ARTEMIS-1980) Warn on failed check of table existence should be info

2018-09-28 Thread ASF GitHub Bot (JIRA)


[ 
https://issues.apache.org/jira/browse/ARTEMIS-1980?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16632212#comment-16632212
 ] 

ASF GitHub Bot commented on ARTEMIS-1980:
-

Github user clebertsuconic commented on a diff in the pull request:

https://github.com/apache/activemq-artemis/pull/2181#discussion_r221341393
  
--- Diff: 
artemis-jdbc-store/src/main/java/org/apache/activemq/artemis/jdbc/store/drivers/AbstractJDBCDriver.java
 ---
@@ -227,7 +227,11 @@ private void createTableIfNotExists(String tableName, 
String... sqls) throws SQL
   }
}
 } catch (SQLException e) {
-   logger.warn(JDBCUtils.appendSQLExceptionDetails(new 
StringBuilder("Can't verify the initialization of table 
").append(tableName).append(" due to:"), e, 
sqlProvider.getCountJournalRecordsSQL()));
+   if (logger.isDebugEnabled()) {
--- End diff --

I feel really wrong on if (logger.isDebug()) logger.debug(...);
else logger.info(...);


it's either always info, or always debug...


> Warn on failed check of table existence should be info
> --
>
> Key: ARTEMIS-1980
> URL: https://issues.apache.org/jira/browse/ARTEMIS-1980
> Project: ActiveMQ Artemis
>  Issue Type: Improvement
>  Components: Broker
>Affects Versions: 2.6.2
>Reporter: Francesco Nigro
>Assignee: Francesco Nigro
>Priority: Trivial
> Fix For: 2.7.0
>
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> DB2 metadata checks should erroneously report stale table existence on
> not existing/just deleted table, making the subsequent warning logs of failed
> SELECT COUNT useless and scaring: should be better to let them lowered to 
> INFO level, avoiding users log reporting tools (if any) to react to an 
> expected behaviour.
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Updated] (ARTEMIS-2101) Do not cluster OpenWire advisory topics

2018-09-28 Thread Francesco Nigro (JIRA)


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

Francesco Nigro updated ARTEMIS-2101:
-
Summary: Do not cluster OpenWire advisory topics  (was: Do not cluster 
Openwire advisory topics)

> Do not cluster OpenWire advisory topics
> ---
>
> Key: ARTEMIS-2101
> URL: https://issues.apache.org/jira/browse/ARTEMIS-2101
> Project: ActiveMQ Artemis
>  Issue Type: Bug
>  Components: Broker, OpenWire
>Affects Versions: 2.6.3
>Reporter: Francesco Nigro
>Assignee: Francesco Nigro
>Priority: Major
> Fix For: 2.7.0, 2.6.4
>
>
> ClusterConnectionBridge isn't correctly filtering out messages relates to 
> advisory topics
> that would be sent across clusters.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Reopened] (ARTEMIS-1545) JMS MessageProducer fails to expose exception on send when message is sent non-persistent, but not authorised

2018-09-28 Thread Robbie Gemmell (JIRA)


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

Robbie Gemmell reopened ARTEMIS-1545:
-

Reopening given discussion around a potential issue.

> JMS MessageProducer fails to expose exception on send when message is sent 
> non-persistent, but not authorised
> -
>
> Key: ARTEMIS-1545
> URL: https://issues.apache.org/jira/browse/ARTEMIS-1545
> Project: ActiveMQ Artemis
>  Issue Type: Bug
>Affects Versions: 2.6.3
>Reporter: Michael Andre Pearce
>Priority: Major
> Fix For: 2.7.0
>
>
> When sending persistent, behaviour is blocking and a Security exception is 
> thrown. The same behaviour that the client is exposed to the client when 
> sending non-persistent, so that a client could log or take action 
> asynchronously. 
> This can be recreated easily by the following:
> Add the following security section , that means guest is not auth'd to send 
> to "guest.cannot.send"
> activemq-artemis/tests/jms-tests/src/test/resources/broker.xml
>  
>
>
>
>
>
>
>
>
> Then add the following tests to this test (first is proving exception 
> correctly is thrown when persistent is sent using jms api, and second shows 
> behaviour difference and no error):
> activemq-artemis/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/SecurityTest.java
>   /**
> * Login with valid user and password
> * But try send to address not authorised - Persistent
> * Should not allow and should throw exception
> */
>@Test
>public void testLoginValidUserAndPasswordButNotAuthorisedToSend() throws 
> Exception {
>   ConnectionFactory connectionFactory = new 
> ActiveMQConnectionFactory("tcp://localhost:61616");
>   Connection connection = connectionFactory.createConnection("guest", 
> "guest");
>   Session session = connection.createSession();
>   Destination destination = session.createQueue("guest.cannot.send");
>   MessageProducer messageProducer = session.createProducer(destination);
>   try {
>  messageProducer.send(session.createTextMessage("hello"));
>  fail("JMSSecurityException expected as guest is not allowed to 
> send");
>   } catch (JMSSecurityException activeMQSecurityException){
>  //pass
>   }
>   connection.close();
>}
>/**
> * Login with valid user and password
> * But try send to address not authorised - Non Persistent.
> * Should have same behaviour as Persistent with exception on send.
> */
>@Test
>public void 
> testLoginValidUserAndPasswordButNotAuthorisedToSendNonPersistent() throws 
> Exception {
>   ConnectionFactory connectionFactory = new 
> ActiveMQConnectionFactory("tcp://localhost:61616");
>   Connection connection = connectionFactory.createConnection("guest", 
> "guest");
>   Session session = connection.createSession();
>   Destination destination = session.createQueue("guest.cannot.send");
>   MessageProducer messageProducer = session.createProducer(destination);
>   messageProducer.setDeliveryMode(DeliveryMode.NON_PERSISTENT);
>   try {
>  messageProducer.send(session.createTextMessage("hello"));
>  fail("JMSSecurityException expected as guest is not allowed to 
> send");
>   } catch (JMSSecurityException activeMQSecurityException){
>  //pass
>   }
>   connection.close();
>}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Created] (ARTEMIS-2101) Do not cluster Openwire advisory topics

2018-09-28 Thread Francesco Nigro (JIRA)
Francesco Nigro created ARTEMIS-2101:


 Summary: Do not cluster Openwire advisory topics
 Key: ARTEMIS-2101
 URL: https://issues.apache.org/jira/browse/ARTEMIS-2101
 Project: ActiveMQ Artemis
  Issue Type: Bug
  Components: Broker, OpenWire
Affects Versions: 2.6.3
Reporter: Francesco Nigro
Assignee: Francesco Nigro
 Fix For: 2.7.0, 2.6.4


ClusterConnectionBridge isn't correctly filtering out messages relates to 
advisory topics

that would be sent across clusters.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (ARTEMIS-2094) Configuration change loss after failover to slave

2018-09-28 Thread Timothy Bish (JIRA)


[ 
https://issues.apache.org/jira/browse/ARTEMIS-2094?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16632116#comment-16632116
 ] 

Timothy Bish commented on ARTEMIS-2094:
---

There's a number of new test failures in the AMQP suite that appeared after 
this commit both on master and on the 2.6.x branch that someone might want to 
check into.  Seems this configuration fix broke other configuration

> Configuration change loss after failover to slave
> -
>
> Key: ARTEMIS-2094
> URL: https://issues.apache.org/jira/browse/ARTEMIS-2094
> Project: ActiveMQ Artemis
>  Issue Type: Bug
>Affects Versions: 2.6.3
>Reporter: Michael Andre Pearce
>Assignee: Michael Andre Pearce
>Priority: Major
>
> This is further cases discovered during testing network failures.
> Essentially we have noticed when config settings are reloaded such as 
> address-setting or security-setting, the live node correctly reloads, but 
> after live failure the backup activates, the backup does not contain these 
> changes due to the configuration object held inside ActiveMQServerImpl is out 
> of date to when the backup server first started.
> so further enhancements/bug fixes on top of ARTEMIS-1747 - Fix Configuration 
> change loss when network Issue. which fixed this for an active node. 
> Essentially we just need to keep the updating of the configuration object in 
> ActiveMQServerImpl outside the isActive check.
> Also address-settings and security settings should be swap'd during 
> initialisation phase 2, so these are set to latest config after activation.
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Updated] (ARTEMIS-1545) JMS MessageProducer fails to expose exception on send when message is sent non-persistent, but not authorised

2018-09-28 Thread clebert suconic (JIRA)


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

clebert suconic updated ARTEMIS-1545:
-
Affects Version/s: 2.6.3
Fix Version/s: 2.7.0

> JMS MessageProducer fails to expose exception on send when message is sent 
> non-persistent, but not authorised
> -
>
> Key: ARTEMIS-1545
> URL: https://issues.apache.org/jira/browse/ARTEMIS-1545
> Project: ActiveMQ Artemis
>  Issue Type: Bug
>Affects Versions: 2.6.3
>Reporter: Michael Andre Pearce
>Priority: Major
> Fix For: 2.7.0
>
>
> When sending persistent, behaviour is blocking and a Security exception is 
> thrown. The same behaviour that the client is exposed to the client when 
> sending non-persistent, so that a client could log or take action 
> asynchronously. 
> This can be recreated easily by the following:
> Add the following security section , that means guest is not auth'd to send 
> to "guest.cannot.send"
> activemq-artemis/tests/jms-tests/src/test/resources/broker.xml
>  
>
>
>
>
>
>
>
>
> Then add the following tests to this test (first is proving exception 
> correctly is thrown when persistent is sent using jms api, and second shows 
> behaviour difference and no error):
> activemq-artemis/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/SecurityTest.java
>   /**
> * Login with valid user and password
> * But try send to address not authorised - Persistent
> * Should not allow and should throw exception
> */
>@Test
>public void testLoginValidUserAndPasswordButNotAuthorisedToSend() throws 
> Exception {
>   ConnectionFactory connectionFactory = new 
> ActiveMQConnectionFactory("tcp://localhost:61616");
>   Connection connection = connectionFactory.createConnection("guest", 
> "guest");
>   Session session = connection.createSession();
>   Destination destination = session.createQueue("guest.cannot.send");
>   MessageProducer messageProducer = session.createProducer(destination);
>   try {
>  messageProducer.send(session.createTextMessage("hello"));
>  fail("JMSSecurityException expected as guest is not allowed to 
> send");
>   } catch (JMSSecurityException activeMQSecurityException){
>  //pass
>   }
>   connection.close();
>}
>/**
> * Login with valid user and password
> * But try send to address not authorised - Non Persistent.
> * Should have same behaviour as Persistent with exception on send.
> */
>@Test
>public void 
> testLoginValidUserAndPasswordButNotAuthorisedToSendNonPersistent() throws 
> Exception {
>   ConnectionFactory connectionFactory = new 
> ActiveMQConnectionFactory("tcp://localhost:61616");
>   Connection connection = connectionFactory.createConnection("guest", 
> "guest");
>   Session session = connection.createSession();
>   Destination destination = session.createQueue("guest.cannot.send");
>   MessageProducer messageProducer = session.createProducer(destination);
>   messageProducer.setDeliveryMode(DeliveryMode.NON_PERSISTENT);
>   try {
>  messageProducer.send(session.createTextMessage("hello"));
>  fail("JMSSecurityException expected as guest is not allowed to 
> send");
>   } catch (JMSSecurityException activeMQSecurityException){
>  //pass
>   }
>   connection.close();
>}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Closed] (ARTEMIS-1545) JMS MessageProducer fails to expose exception on send when message is sent non-persistent, but not authorised

2018-09-28 Thread clebert suconic (JIRA)


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

clebert suconic closed ARTEMIS-1545.

Resolution: Fixed

> JMS MessageProducer fails to expose exception on send when message is sent 
> non-persistent, but not authorised
> -
>
> Key: ARTEMIS-1545
> URL: https://issues.apache.org/jira/browse/ARTEMIS-1545
> Project: ActiveMQ Artemis
>  Issue Type: Bug
>Affects Versions: 2.6.3
>Reporter: Michael Andre Pearce
>Priority: Major
> Fix For: 2.7.0
>
>
> When sending persistent, behaviour is blocking and a Security exception is 
> thrown. The same behaviour that the client is exposed to the client when 
> sending non-persistent, so that a client could log or take action 
> asynchronously. 
> This can be recreated easily by the following:
> Add the following security section , that means guest is not auth'd to send 
> to "guest.cannot.send"
> activemq-artemis/tests/jms-tests/src/test/resources/broker.xml
>  
>
>
>
>
>
>
>
>
> Then add the following tests to this test (first is proving exception 
> correctly is thrown when persistent is sent using jms api, and second shows 
> behaviour difference and no error):
> activemq-artemis/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/SecurityTest.java
>   /**
> * Login with valid user and password
> * But try send to address not authorised - Persistent
> * Should not allow and should throw exception
> */
>@Test
>public void testLoginValidUserAndPasswordButNotAuthorisedToSend() throws 
> Exception {
>   ConnectionFactory connectionFactory = new 
> ActiveMQConnectionFactory("tcp://localhost:61616");
>   Connection connection = connectionFactory.createConnection("guest", 
> "guest");
>   Session session = connection.createSession();
>   Destination destination = session.createQueue("guest.cannot.send");
>   MessageProducer messageProducer = session.createProducer(destination);
>   try {
>  messageProducer.send(session.createTextMessage("hello"));
>  fail("JMSSecurityException expected as guest is not allowed to 
> send");
>   } catch (JMSSecurityException activeMQSecurityException){
>  //pass
>   }
>   connection.close();
>}
>/**
> * Login with valid user and password
> * But try send to address not authorised - Non Persistent.
> * Should have same behaviour as Persistent with exception on send.
> */
>@Test
>public void 
> testLoginValidUserAndPasswordButNotAuthorisedToSendNonPersistent() throws 
> Exception {
>   ConnectionFactory connectionFactory = new 
> ActiveMQConnectionFactory("tcp://localhost:61616");
>   Connection connection = connectionFactory.createConnection("guest", 
> "guest");
>   Session session = connection.createSession();
>   Destination destination = session.createQueue("guest.cannot.send");
>   MessageProducer messageProducer = session.createProducer(destination);
>   messageProducer.setDeliveryMode(DeliveryMode.NON_PERSISTENT);
>   try {
>  messageProducer.send(session.createTextMessage("hello"));
>  fail("JMSSecurityException expected as guest is not allowed to 
> send");
>   } catch (JMSSecurityException activeMQSecurityException){
>  //pass
>   }
>   connection.close();
>}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (ARTEMIS-1545) JMS MessageProducer fails to expose exception on send when message is sent non-persistent, but not authorised

2018-09-28 Thread ASF GitHub Bot (JIRA)


[ 
https://issues.apache.org/jira/browse/ARTEMIS-1545?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16632016#comment-16632016
 ] 

ASF GitHub Bot commented on ARTEMIS-1545:
-

Github user michaelandrepearce commented on a diff in the pull request:

https://github.com/apache/activemq-artemis/pull/2187#discussion_r221293865
  
--- Diff: 
artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/client/SendAcknowledgementHandler.java
 ---
@@ -41,4 +41,13 @@
 * @param message message sent asynchronously
 */
void sendAcknowledged(Message message);
+
+   default void sendFailed(Message message, Exception e) {
+  /**
+   * By default ignore failures to preserve compatibility with 
existing implementations.
+   * If the message makes it to the broker and a failure occurs 
sendAcknowledge() will
--- End diff --

Ill let @jbertram comment here in original version it was done but for 
reason justin changed it. Im sure for good reason 


> JMS MessageProducer fails to expose exception on send when message is sent 
> non-persistent, but not authorised
> -
>
> Key: ARTEMIS-1545
> URL: https://issues.apache.org/jira/browse/ARTEMIS-1545
> Project: ActiveMQ Artemis
>  Issue Type: Bug
>Reporter: Michael Andre Pearce
>Priority: Major
>
> When sending persistent, behaviour is blocking and a Security exception is 
> thrown. The same behaviour that the client is exposed to the client when 
> sending non-persistent, so that a client could log or take action 
> asynchronously. 
> This can be recreated easily by the following:
> Add the following security section , that means guest is not auth'd to send 
> to "guest.cannot.send"
> activemq-artemis/tests/jms-tests/src/test/resources/broker.xml
>  
>
>
>
>
>
>
>
>
> Then add the following tests to this test (first is proving exception 
> correctly is thrown when persistent is sent using jms api, and second shows 
> behaviour difference and no error):
> activemq-artemis/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/SecurityTest.java
>   /**
> * Login with valid user and password
> * But try send to address not authorised - Persistent
> * Should not allow and should throw exception
> */
>@Test
>public void testLoginValidUserAndPasswordButNotAuthorisedToSend() throws 
> Exception {
>   ConnectionFactory connectionFactory = new 
> ActiveMQConnectionFactory("tcp://localhost:61616");
>   Connection connection = connectionFactory.createConnection("guest", 
> "guest");
>   Session session = connection.createSession();
>   Destination destination = session.createQueue("guest.cannot.send");
>   MessageProducer messageProducer = session.createProducer(destination);
>   try {
>  messageProducer.send(session.createTextMessage("hello"));
>  fail("JMSSecurityException expected as guest is not allowed to 
> send");
>   } catch (JMSSecurityException activeMQSecurityException){
>  //pass
>   }
>   connection.close();
>}
>/**
> * Login with valid user and password
> * But try send to address not authorised - Non Persistent.
> * Should have same behaviour as Persistent with exception on send.
> */
>@Test
>public void 
> testLoginValidUserAndPasswordButNotAuthorisedToSendNonPersistent() throws 
> Exception {
>   ConnectionFactory connectionFactory = new 
> ActiveMQConnectionFactory("tcp://localhost:61616");
>   Connection connection = connectionFactory.createConnection("guest", 
> "guest");
>   Session session = connection.createSession();
>   Destination destination = session.createQueue("guest.cannot.send");
>   MessageProducer messageProducer = session.createProducer(destination);
>   messageProducer.setDeliveryMode(DeliveryMode.NON_PERSISTENT);
>   try {
>  messageProducer.send(session.createTextMessage("hello"));
>  fail("JMSSecurityException expected as guest is not allowed to 
> send");
>   } catch (JMSSecurityException activeMQSecurityException){
>  //pass
>   }
>   connection.close();
>}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (ARTEMIS-2097) Pause and Block Producers

2018-09-28 Thread Howard Gao (JIRA)


[ 
https://issues.apache.org/jira/browse/ARTEMIS-2097?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16631835#comment-16631835
 ] 

Howard Gao commented on ARTEMIS-2097:
-

[~clebertsuconic] the credits may work for core clients, but it may not work 
for other protocol clients, who have different kind of flow control. Is that 
right?

 

> Pause and Block Producers
> -
>
> Key: ARTEMIS-2097
> URL: https://issues.apache.org/jira/browse/ARTEMIS-2097
> Project: ActiveMQ Artemis
>  Issue Type: New Feature
>  Components: Broker
>Affects Versions: 1.5.5
> Environment: AMQ-1.5.5
>Reporter: Tyronne Wickramarathne
>Assignee: Howard Gao
>Priority: Major
> Fix For: unscheduled
>
>
> Could it be possible to block all incoming messages without changing the 
> address-full-policy to 'BLOCK'?
> The address full policy can be configured to block incoming messages should 
> the address full policy reaches the configured max-size-bytes attributes.
> However, on certain circumstances it is important to make a JMS destination 
> drain without accepting incoming messages while keeping the 
> address-full-policy at 'PAGE'. For an instance, if a user needs to bring down 
> the broker for maintenance, it is important to allow the user to drain 
> existing messages in the corresponding destination without accepting any new 
> messages.
>  
> Currently the pause() method on a destination pauses message consumers. In a 
> similar fashion could it be possible to add a new method to block message 
> producers on a given destination irrespective of the address-full-policy 
> being used?



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (ARTEMIS-1545) JMS MessageProducer fails to expose exception on send when message is sent non-persistent, but not authorised

2018-09-28 Thread ASF subversion and git services (JIRA)


[ 
https://issues.apache.org/jira/browse/ARTEMIS-1545?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16631822#comment-16631822
 ] 

ASF subversion and git services commented on ARTEMIS-1545:
--

Commit 2242d2447cdaaf3f7ad59f1b9c342035e9b8426e in activemq-artemis's branch 
refs/heads/2.6.x from Clebert Suconic
[ https://git-wip-us.apache.org/repos/asf?p=activemq-artemis.git;h=2242d24 ]

Reverting JMS Completion listener on 2.6.x..

This change is too big for maintainance branch. Reverting it.

Revert "ARTEMIS-1545 refactor & rework a few incompatible pieces"
Revert "ARTEMIS-1545 Support JMS 2.0 Completion Listener for Exceptions"

This reverts commit c9d8697a6cf5e4620970da878fc5ab4f8d9d148f.
This reverts commit f4734868a5a07dfc6db533a96f9f8e01de5139c5.


> JMS MessageProducer fails to expose exception on send when message is sent 
> non-persistent, but not authorised
> -
>
> Key: ARTEMIS-1545
> URL: https://issues.apache.org/jira/browse/ARTEMIS-1545
> Project: ActiveMQ Artemis
>  Issue Type: Bug
>Reporter: Michael Andre Pearce
>Priority: Major
>
> When sending persistent, behaviour is blocking and a Security exception is 
> thrown. The same behaviour that the client is exposed to the client when 
> sending non-persistent, so that a client could log or take action 
> asynchronously. 
> This can be recreated easily by the following:
> Add the following security section , that means guest is not auth'd to send 
> to "guest.cannot.send"
> activemq-artemis/tests/jms-tests/src/test/resources/broker.xml
>  
>
>
>
>
>
>
>
>
> Then add the following tests to this test (first is proving exception 
> correctly is thrown when persistent is sent using jms api, and second shows 
> behaviour difference and no error):
> activemq-artemis/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/SecurityTest.java
>   /**
> * Login with valid user and password
> * But try send to address not authorised - Persistent
> * Should not allow and should throw exception
> */
>@Test
>public void testLoginValidUserAndPasswordButNotAuthorisedToSend() throws 
> Exception {
>   ConnectionFactory connectionFactory = new 
> ActiveMQConnectionFactory("tcp://localhost:61616");
>   Connection connection = connectionFactory.createConnection("guest", 
> "guest");
>   Session session = connection.createSession();
>   Destination destination = session.createQueue("guest.cannot.send");
>   MessageProducer messageProducer = session.createProducer(destination);
>   try {
>  messageProducer.send(session.createTextMessage("hello"));
>  fail("JMSSecurityException expected as guest is not allowed to 
> send");
>   } catch (JMSSecurityException activeMQSecurityException){
>  //pass
>   }
>   connection.close();
>}
>/**
> * Login with valid user and password
> * But try send to address not authorised - Non Persistent.
> * Should have same behaviour as Persistent with exception on send.
> */
>@Test
>public void 
> testLoginValidUserAndPasswordButNotAuthorisedToSendNonPersistent() throws 
> Exception {
>   ConnectionFactory connectionFactory = new 
> ActiveMQConnectionFactory("tcp://localhost:61616");
>   Connection connection = connectionFactory.createConnection("guest", 
> "guest");
>   Session session = connection.createSession();
>   Destination destination = session.createQueue("guest.cannot.send");
>   MessageProducer messageProducer = session.createProducer(destination);
>   messageProducer.setDeliveryMode(DeliveryMode.NON_PERSISTENT);
>   try {
>  messageProducer.send(session.createTextMessage("hello"));
>  fail("JMSSecurityException expected as guest is not allowed to 
> send");
>   } catch (JMSSecurityException activeMQSecurityException){
>  //pass
>   }
>   connection.close();
>}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (ARTEMIS-1545) JMS MessageProducer fails to expose exception on send when message is sent non-persistent, but not authorised

2018-09-28 Thread ASF subversion and git services (JIRA)


[ 
https://issues.apache.org/jira/browse/ARTEMIS-1545?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16631823#comment-16631823
 ] 

ASF subversion and git services commented on ARTEMIS-1545:
--

Commit 2242d2447cdaaf3f7ad59f1b9c342035e9b8426e in activemq-artemis's branch 
refs/heads/2.6.x from Clebert Suconic
[ https://git-wip-us.apache.org/repos/asf?p=activemq-artemis.git;h=2242d24 ]

Reverting JMS Completion listener on 2.6.x..

This change is too big for maintainance branch. Reverting it.

Revert "ARTEMIS-1545 refactor & rework a few incompatible pieces"
Revert "ARTEMIS-1545 Support JMS 2.0 Completion Listener for Exceptions"

This reverts commit c9d8697a6cf5e4620970da878fc5ab4f8d9d148f.
This reverts commit f4734868a5a07dfc6db533a96f9f8e01de5139c5.


> JMS MessageProducer fails to expose exception on send when message is sent 
> non-persistent, but not authorised
> -
>
> Key: ARTEMIS-1545
> URL: https://issues.apache.org/jira/browse/ARTEMIS-1545
> Project: ActiveMQ Artemis
>  Issue Type: Bug
>Reporter: Michael Andre Pearce
>Priority: Major
>
> When sending persistent, behaviour is blocking and a Security exception is 
> thrown. The same behaviour that the client is exposed to the client when 
> sending non-persistent, so that a client could log or take action 
> asynchronously. 
> This can be recreated easily by the following:
> Add the following security section , that means guest is not auth'd to send 
> to "guest.cannot.send"
> activemq-artemis/tests/jms-tests/src/test/resources/broker.xml
>  
>
>
>
>
>
>
>
>
> Then add the following tests to this test (first is proving exception 
> correctly is thrown when persistent is sent using jms api, and second shows 
> behaviour difference and no error):
> activemq-artemis/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/SecurityTest.java
>   /**
> * Login with valid user and password
> * But try send to address not authorised - Persistent
> * Should not allow and should throw exception
> */
>@Test
>public void testLoginValidUserAndPasswordButNotAuthorisedToSend() throws 
> Exception {
>   ConnectionFactory connectionFactory = new 
> ActiveMQConnectionFactory("tcp://localhost:61616");
>   Connection connection = connectionFactory.createConnection("guest", 
> "guest");
>   Session session = connection.createSession();
>   Destination destination = session.createQueue("guest.cannot.send");
>   MessageProducer messageProducer = session.createProducer(destination);
>   try {
>  messageProducer.send(session.createTextMessage("hello"));
>  fail("JMSSecurityException expected as guest is not allowed to 
> send");
>   } catch (JMSSecurityException activeMQSecurityException){
>  //pass
>   }
>   connection.close();
>}
>/**
> * Login with valid user and password
> * But try send to address not authorised - Non Persistent.
> * Should have same behaviour as Persistent with exception on send.
> */
>@Test
>public void 
> testLoginValidUserAndPasswordButNotAuthorisedToSendNonPersistent() throws 
> Exception {
>   ConnectionFactory connectionFactory = new 
> ActiveMQConnectionFactory("tcp://localhost:61616");
>   Connection connection = connectionFactory.createConnection("guest", 
> "guest");
>   Session session = connection.createSession();
>   Destination destination = session.createQueue("guest.cannot.send");
>   MessageProducer messageProducer = session.createProducer(destination);
>   messageProducer.setDeliveryMode(DeliveryMode.NON_PERSISTENT);
>   try {
>  messageProducer.send(session.createTextMessage("hello"));
>  fail("JMSSecurityException expected as guest is not allowed to 
> send");
>   } catch (JMSSecurityException activeMQSecurityException){
>  //pass
>   }
>   connection.close();
>}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (ARTEMIS-2097) Pause and Block Producers

2018-09-28 Thread Howard Gao (JIRA)


[ 
https://issues.apache.org/jira/browse/ARTEMIS-2097?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16631818#comment-16631818
 ] 

Howard Gao commented on ARTEMIS-2097:
-

I'm thinking adding a method on AddressControl and another on ServerControl.

It should be based on addresses as messages are sending to addresses.

 

> Pause and Block Producers
> -
>
> Key: ARTEMIS-2097
> URL: https://issues.apache.org/jira/browse/ARTEMIS-2097
> Project: ActiveMQ Artemis
>  Issue Type: New Feature
>  Components: Broker
>Affects Versions: 1.5.5
> Environment: AMQ-1.5.5
>Reporter: Tyronne Wickramarathne
>Assignee: Howard Gao
>Priority: Major
> Fix For: unscheduled
>
>
> Could it be possible to block all incoming messages without changing the 
> address-full-policy to 'BLOCK'?
> The address full policy can be configured to block incoming messages should 
> the address full policy reaches the configured max-size-bytes attributes.
> However, on certain circumstances it is important to make a JMS destination 
> drain without accepting incoming messages while keeping the 
> address-full-policy at 'PAGE'. For an instance, if a user needs to bring down 
> the broker for maintenance, it is important to allow the user to drain 
> existing messages in the corresponding destination without accepting any new 
> messages.
>  
> Currently the pause() method on a destination pauses message consumers. In a 
> similar fashion could it be possible to add a new method to block message 
> producers on a given destination irrespective of the address-full-policy 
> being used?



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (ARTEMIS-1980) Warn on failed check of table existence should be info

2018-09-28 Thread ASF GitHub Bot (JIRA)


[ 
https://issues.apache.org/jira/browse/ARTEMIS-1980?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16631747#comment-16631747
 ] 

ASF GitHub Bot commented on ARTEMIS-1980:
-

Github user franz1981 commented on a diff in the pull request:

https://github.com/apache/activemq-artemis/pull/2181#discussion_r221229493
  
--- Diff: 
artemis-jdbc-store/src/main/java/org/apache/activemq/artemis/jdbc/store/drivers/AbstractJDBCDriver.java
 ---
@@ -227,7 +227,11 @@ private void createTableIfNotExists(String tableName, 
String... sqls) throws SQL
   }
}
 } catch (SQLException e) {
-   logger.warn(JDBCUtils.appendSQLExceptionDetails(new 
StringBuilder("Can't verify the initialization of table 
").append(tableName).append(" due to:"), e, 
sqlProvider.getCountJournalRecordsSQL()));
+   if (logger.isDebugEnabled()) {
+  logger.debug(JDBCUtils.appendSQLExceptionDetails(new 
StringBuilder("Can't verify the initialization of table 
").append(tableName).append(" due to:"), e, 
sqlProvider.getCountJournalRecordsSQL()));
+   } else {
+  logger.infof("Can't verify the initialization of table 
%s", tableName);
--- End diff --

@clebertsuconic There is anything I need to do in order to get it merged 
mate?


> Warn on failed check of table existence should be info
> --
>
> Key: ARTEMIS-1980
> URL: https://issues.apache.org/jira/browse/ARTEMIS-1980
> Project: ActiveMQ Artemis
>  Issue Type: Improvement
>  Components: Broker
>Affects Versions: 2.6.2
>Reporter: Francesco Nigro
>Assignee: Francesco Nigro
>Priority: Trivial
> Fix For: 2.7.0
>
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> DB2 metadata checks should erroneously report stale table existence on
> not existing/just deleted table, making the subsequent warning logs of failed
> SELECT COUNT useless and scaring: should be better to let them lowered to 
> INFO level, avoiding users log reporting tools (if any) to react to an 
> expected behaviour.
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (ARTEMIS-1545) JMS MessageProducer fails to expose exception on send when message is sent non-persistent, but not authorised

2018-09-28 Thread ASF GitHub Bot (JIRA)


[ 
https://issues.apache.org/jira/browse/ARTEMIS-1545?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16631603#comment-16631603
 ] 

ASF GitHub Bot commented on ARTEMIS-1545:
-

Github user gemmellr commented on a diff in the pull request:

https://github.com/apache/activemq-artemis/pull/2187#discussion_r221189768
  
--- Diff: 
artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/client/SendAcknowledgementHandler.java
 ---
@@ -41,4 +41,13 @@
 * @param message message sent asynchronously
 */
void sendAcknowledged(Message message);
+
+   default void sendFailed(Message message, Exception e) {
+  /**
+   * By default ignore failures to preserve compatibility with 
existing implementations.
+   * If the message makes it to the broker and a failure occurs 
sendAcknowledge() will
--- End diff --

Is this actually true? From skimming the diff it seems like it may not be 
as there are some if-else sections added that call one of the handler methods 
only. Unless somewhere else is also calling the sendAcknowledged method 
(possibly in duplicate?) then it seems if only the failure method gets called, 
and this default method drops it, that would mean an existing listener that 
doesn't implement sendFailed then wont see anything at all now. IF that is the 
case it suggests some tests are missing.

Should this default method impl perhaps be calling sendAcknowledged()? 
(uglier alternative, the calling code could check the sendFailed method is 
actually implemented and decide which to call)


> JMS MessageProducer fails to expose exception on send when message is sent 
> non-persistent, but not authorised
> -
>
> Key: ARTEMIS-1545
> URL: https://issues.apache.org/jira/browse/ARTEMIS-1545
> Project: ActiveMQ Artemis
>  Issue Type: Bug
>Reporter: Michael Andre Pearce
>Priority: Major
>
> When sending persistent, behaviour is blocking and a Security exception is 
> thrown. The same behaviour that the client is exposed to the client when 
> sending non-persistent, so that a client could log or take action 
> asynchronously. 
> This can be recreated easily by the following:
> Add the following security section , that means guest is not auth'd to send 
> to "guest.cannot.send"
> activemq-artemis/tests/jms-tests/src/test/resources/broker.xml
>  
>
>
>
>
>
>
>
>
> Then add the following tests to this test (first is proving exception 
> correctly is thrown when persistent is sent using jms api, and second shows 
> behaviour difference and no error):
> activemq-artemis/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/SecurityTest.java
>   /**
> * Login with valid user and password
> * But try send to address not authorised - Persistent
> * Should not allow and should throw exception
> */
>@Test
>public void testLoginValidUserAndPasswordButNotAuthorisedToSend() throws 
> Exception {
>   ConnectionFactory connectionFactory = new 
> ActiveMQConnectionFactory("tcp://localhost:61616");
>   Connection connection = connectionFactory.createConnection("guest", 
> "guest");
>   Session session = connection.createSession();
>   Destination destination = session.createQueue("guest.cannot.send");
>   MessageProducer messageProducer = session.createProducer(destination);
>   try {
>  messageProducer.send(session.createTextMessage("hello"));
>  fail("JMSSecurityException expected as guest is not allowed to 
> send");
>   } catch (JMSSecurityException activeMQSecurityException){
>  //pass
>   }
>   connection.close();
>}
>/**
> * Login with valid user and password
> * But try send to address not authorised - Non Persistent.
> * Should have same behaviour as Persistent with exception on send.
> */
>@Test
>public void 
> testLoginValidUserAndPasswordButNotAuthorisedToSendNonPersistent() throws 
> Exception {
>   ConnectionFactory connectionFactory = new 
> ActiveMQConnectionFactory("tcp://localhost:61616");
>   Connection connection = connectionFactory.createConnection("guest", 
> "guest");
>   Session session = connection.createSession();
>   Destination destination = session.createQueue("guest.cannot.send");
>   MessageProducer messageProducer = session.createProducer(destination);
>   messageProducer.setDeliveryMode(DeliveryMode.NON_PERSISTENT);
>   try {
>  messageProducer.send(session.createTextMessage("hello"));
>  fail("JMSSecurityException expected as guest is not allowed t

[jira] [Commented] (ARTEMIS-1545) JMS MessageProducer fails to expose exception on send when message is sent non-persistent, but not authorised

2018-09-28 Thread ASF GitHub Bot (JIRA)


[ 
https://issues.apache.org/jira/browse/ARTEMIS-1545?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16631604#comment-16631604
 ] 

ASF GitHub Bot commented on ARTEMIS-1545:
-

Github user gemmellr commented on a diff in the pull request:

https://github.com/apache/activemq-artemis/pull/2187#discussion_r221191158
  
--- Diff: 
artemis-jms-client/src/main/java/org/apache/activemq/artemis/jms/client/ActiveMQMessageProducer.java
 ---
@@ -577,26 +587,62 @@ private CompletionListenerWrapper(CompletionListener 
listener,
 
   @Override
   public void 
sendAcknowledged(org.apache.activemq.artemis.api.core.Message clientMessage) {
- if (jmsMessage instanceof StreamMessage) {
-try {
-   ((StreamMessage) jmsMessage).reset();
-} catch (JMSException e) {
-   // HORNETQ-1209 XXX ignore?
+ if (active.get()) {
--- End diff --

Doing a getAndSet seems like it might be nicer given the aim to ensure only 
a single processing and call on the CompletionListener occurs. Granted though 
its not likely that multiple concurrent attempts are going to be made here.


> JMS MessageProducer fails to expose exception on send when message is sent 
> non-persistent, but not authorised
> -
>
> Key: ARTEMIS-1545
> URL: https://issues.apache.org/jira/browse/ARTEMIS-1545
> Project: ActiveMQ Artemis
>  Issue Type: Bug
>Reporter: Michael Andre Pearce
>Priority: Major
>
> When sending persistent, behaviour is blocking and a Security exception is 
> thrown. The same behaviour that the client is exposed to the client when 
> sending non-persistent, so that a client could log or take action 
> asynchronously. 
> This can be recreated easily by the following:
> Add the following security section , that means guest is not auth'd to send 
> to "guest.cannot.send"
> activemq-artemis/tests/jms-tests/src/test/resources/broker.xml
>  
>
>
>
>
>
>
>
>
> Then add the following tests to this test (first is proving exception 
> correctly is thrown when persistent is sent using jms api, and second shows 
> behaviour difference and no error):
> activemq-artemis/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/SecurityTest.java
>   /**
> * Login with valid user and password
> * But try send to address not authorised - Persistent
> * Should not allow and should throw exception
> */
>@Test
>public void testLoginValidUserAndPasswordButNotAuthorisedToSend() throws 
> Exception {
>   ConnectionFactory connectionFactory = new 
> ActiveMQConnectionFactory("tcp://localhost:61616");
>   Connection connection = connectionFactory.createConnection("guest", 
> "guest");
>   Session session = connection.createSession();
>   Destination destination = session.createQueue("guest.cannot.send");
>   MessageProducer messageProducer = session.createProducer(destination);
>   try {
>  messageProducer.send(session.createTextMessage("hello"));
>  fail("JMSSecurityException expected as guest is not allowed to 
> send");
>   } catch (JMSSecurityException activeMQSecurityException){
>  //pass
>   }
>   connection.close();
>}
>/**
> * Login with valid user and password
> * But try send to address not authorised - Non Persistent.
> * Should have same behaviour as Persistent with exception on send.
> */
>@Test
>public void 
> testLoginValidUserAndPasswordButNotAuthorisedToSendNonPersistent() throws 
> Exception {
>   ConnectionFactory connectionFactory = new 
> ActiveMQConnectionFactory("tcp://localhost:61616");
>   Connection connection = connectionFactory.createConnection("guest", 
> "guest");
>   Session session = connection.createSession();
>   Destination destination = session.createQueue("guest.cannot.send");
>   MessageProducer messageProducer = session.createProducer(destination);
>   messageProducer.setDeliveryMode(DeliveryMode.NON_PERSISTENT);
>   try {
>  messageProducer.send(session.createTextMessage("hello"));
>  fail("JMSSecurityException expected as guest is not allowed to 
> send");
>   } catch (JMSSecurityException activeMQSecurityException){
>  //pass
>   }
>   connection.close();
>}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (ARTEMIS-1874) NPE in ActiveMQMessage.setObjectProperty

2018-09-28 Thread ASF GitHub Bot (JIRA)


[ 
https://issues.apache.org/jira/browse/ARTEMIS-1874?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16631541#comment-16631541
 ] 

ASF GitHub Bot commented on ARTEMIS-1874:
-

Github user rpelisse commented on the issue:

https://github.com/apache/activemq-artemis/pull/2336
  
But of course! Just done so (and thanks for the tip, never noticed this -x 
option, it's pretty neat).


> NPE in ActiveMQMessage.setObjectProperty
> 
>
> Key: ARTEMIS-1874
> URL: https://issues.apache.org/jira/browse/ARTEMIS-1874
> Project: ActiveMQ Artemis
>  Issue Type: Bug
>Affects Versions: 2.6.0
>Reporter: Alastair Mailer
>Assignee: Justin Bertram
>Priority: Critical
> Fix For: 2.6.1, 2.7.0
>
>
> Calling ActiveMQMessage.setObjectProperty("name", null) causes an NPE in 
> handleCoreProperty line 968 (value.toString()) if "name" is either 
> "JMSXGroupID" or "JMSXUserID".



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)