Re: [Artemis] NPE on server (re)start

2018-05-15 Thread Archibald
@Justin: Bingo! Disk usage was above the threshold of 90%.

Thank you so much!

Br, 
A.



--
Sent from: http://activemq.2283324.n4.nabble.com/ActiveMQ-User-f2341805.html


Re: [Artemis] NPE on server (re)start

2018-05-14 Thread Archibald
Strange, 

artemis address show reads

2018-05-14 13:43:50,777 WARN  [org.apache.activemq.artemis.core.client]
AMQ212054: Destination address=activemq.management is blocked. If the system
is configured to block make sure you consume messages on this configuration.

But the queue is (also) empty.





--
Sent from: http://activemq.2283324.n4.nabble.com/ActiveMQ-User-f2341805.html


Re: [Artemis] NPE on server (re)start

2018-05-14 Thread Archibald
Hi, 

Last time I removed the perstint, so I cannot help with internal data for
debugging.

But now I get another strange issue regarding paging (I suppose).

Broker is complaining about Disk being full.

2018-05-14 13:12:36,431 WARN  [org.apache.activemq.artemis.core.server]
AMQ12: Disk Full! Blocking message production on address ''.
Clients will report blocked.

The broker itself is doing rather nothing (no traffic at all), nothing
enqueued.

artemis print data says:
 __   _
/ \  | |_  ___ __  __(_) _
   / _ \|  _ \ __|/ _ \  \/  | |/  __/
  / ___ \ | \/ |_/  __/ |\/| | |\___ \
 /_/   \_\|   \__\|_|  |_|_|/___ /
 Apache ActiveMQ Artemis 2.5.0




Server's ID=aa9cf610-552e-11e8-8f53-0242ac120004



B I N D I N G S  J O U R N A L

Journal path: /var/lib/artemis/data/bindings
#JournalFileImpl: (activemq-bindings-1.bindings id = 1, recordID = 1)
(size=1048576)
operation@AddRecord;recordID=1;userRecordType=24;isUpdate=false;compactCount=0;IDCounterEncoding
[id=2147483647]
operation@AddRecordTX;txID=0,recordID=2;userRecordType=44;isUpdate=false;compactCount=0;PersistentAddressBindingEncoding(safe
data)
operation@Commit;txID=0,numberOfRecords=1
operation@AddRecordTX;txID=3,recordID=4;userRecordType=21;isUpdate=false;compactCount=0;PersistentQueueBindingEncoding(safe
data)
operation@Commit;txID=3,numberOfRecords=1
operation@AddRecordTX;txID=5,recordID=6;userRecordType=44;isUpdate=false;compactCount=0;PersistentAddressBindingEncoding(safe
data)
operation@Commit;txID=5,numberOfRecords=1
operation@AddRecordTX;txID=7,recordID=8;userRecordType=21;isUpdate=false;compactCount=0;PersistentQueueBindingEncoding(safe
data)
operation@Commit;txID=7,numberOfRecords=1
operation@AddRecordTX;txID=9,recordID=10;userRecordType=44;isUpdate=false;compactCount=0;PersistentAddressBindingEncoding(safe
data)
operation@Commit;txID=9,numberOfRecords=1
operation@AddRecordTX;txID=11,recordID=12;userRecordType=44;isUpdate=false;compactCount=0;PersistentAddressBindingEncoding(safe
data)
operation@Commit;txID=11,numberOfRecords=1
operation@AddRecordTX;txID=13,recordID=14;userRecordType=21;isUpdate=false;compactCount=0;PersistentQueueBindingEncoding(safe
data)
operation@Commit;txID=13,numberOfRecords=1
operation@AddRecordTX;txID=15,recordID=16;userRecordType=44;isUpdate=false;compactCount=0;PersistentAddressBindingEncoding(safe
data)
operation@Commit;txID=15,numberOfRecords=1
operation@AddRecordTX;txID=17,recordID=18;userRecordType=21;isUpdate=false;compactCount=0;PersistentQueueBindingEncoding(safe
data)
operation@Commit;txID=17,numberOfRecords=1
operation@AddRecordTX;txID=19,recordID=20;userRecordType=44;isUpdate=false;compactCount=0;PersistentAddressBindingEncoding(safe
data)
operation@Commit;txID=19,numberOfRecords=1
operation@AddRecordTX;txID=21,recordID=22;userRecordType=21;isUpdate=false;compactCount=0;PersistentQueueBindingEncoding(safe
data)
operation@Commit;txID=21,numberOfRecords=1
operation@AddRecordTX;txID=23,recordID=24;userRecordType=44;isUpdate=false;compactCount=0;PersistentAddressBindingEncoding(safe
data)
operation@Commit;txID=23,numberOfRecords=1
operation@AddRecordTX;txID=25,recordID=26;userRecordType=21;isUpdate=false;compactCount=0;PersistentQueueBindingEncoding(safe
data)
operation@Commit;txID=25,numberOfRecords=1
operation@AddRecordTX;txID=27,recordID=28;userRecordType=44;isUpdate=false;compactCount=0;PersistentAddressBindingEncoding(safe
data)
operation@Commit;txID=27,numberOfRecords=1
operation@AddRecordTX;txID=29,recordID=30;userRecordType=21;isUpdate=false;compactCount=0;PersistentQueueBindingEncoding(safe
data)
operation@Commit;txID=29,numberOfRecords=1
operation@AddRecordTX;txID=31,recordID=32;userRecordType=44;isUpdate=false;compactCount=0;PersistentAddressBindingEncoding(safe
data)
operation@Commit;txID=31,numberOfRecords=1
operation@AddRecordTX;txID=33,recordID=34;userRecordType=21;isUpdate=false;compactCount=0;PersistentQueueBindingEncoding(safe
data)
operation@Commit;txID=33,numberOfRecords=1
operation@AddRecordTX;txID=35,recordID=36;userRecordType=44;isUpdate=false;compactCount=0;PersistentAddressBindingEncoding(safe
data)
operation@Commit;txID=35,numberOfRecords=1
operation@AddRecordTX;txID=37,recordID=38;userRecordType=21;isUpdate=false;compactCount=0;PersistentQueueBindingEncoding(safe
data)
operation@Commit;txID=37,numberOfRecords=1
operation@AddRecordTX;txID=39,recordID=40;userRecordType=44;isUpdate=false;compactCount=0;PersistentAddressBindingEncoding(safe
data)
operation@Commit;txID=39,numberOfRecords=1
operation@AddRecord;recordID=749406;userRecordType=24;isUpdate=false;compactCount=0;IDCounterEncoding
[id=749406]
operation@DeleteRecord;recordID=1
operation@AddRecord;recordID=749408;userRecordType=24;isUpdate=false;compactCount=0;IDCounterEncoding
[id=2148233054]
#JournalFileImpl: 

[Artemis] NPE on server (re)start

2018-05-11 Thread Archibald
Hi, 

Yesterday the server (version 2.5.0) was processing > 2m messages, today I
needed to restart the broker but it failed with
an NPE.

Here's the log.

2018-05-11 10:19:22,898 INFO 
[org.apache.activemq.artemis.integration.bootstrap] AMQ101000: Starting
ActiveMQ Artemis Server
2018-05-11 10:19:23,017 INFO  [org.apache.activemq.artemis.core.server]
AMQ221000: live Message Broker is starting with configuration Broker
Configuration
(clustered=true,journalDirectory=data/journal,bindingsDirectory=data/bindings,largeMessagesDirectory=data/large-messages,pagingDirectory=data/paging)
2018-05-11 10:19:23,063 INFO  [org.apache.activemq.artemis.core.server]
AMQ221012: Using AIO Journal
2018-05-11 10:19:23,134 INFO  [org.apache.activemq.artemis.core.server]
AMQ221057: Global Max Size is being adjusted to 1/2 of the JVM max size
(-Xmx). being defined as 1,342,177,280
2018-05-11 10:19:23,249 INFO  [org.apache.activemq.artemis.core.server]
AMQ221043: Protocol module found: [artemis-server]. Adding protocol support
for: CORE
2018-05-11 10:19:23,253 INFO  [org.apache.activemq.artemis.core.server]
AMQ221043: Protocol module found: [artemis-amqp-protocol]. Adding protocol
support for: AMQP
2018-05-11 10:19:23,253 INFO  [org.apache.activemq.artemis.core.server]
AMQ221043: Protocol module found: [artemis-hornetq-protocol]. Adding
protocol support for: HORNETQ
2018-05-11 10:19:23,254 INFO  [org.apache.activemq.artemis.core.server]
AMQ221043: Protocol module found: [artemis-mqtt-protocol]. Adding protocol
support for: MQTT
2018-05-11 10:19:23,254 INFO  [org.apache.activemq.artemis.core.server]
AMQ221043: Protocol module found: [artemis-openwire-protocol]. Adding
protocol support for: OPENWIRE
2018-05-11 10:19:23,255 INFO  [org.apache.activemq.artemis.core.server]
AMQ221043: Protocol module found: [artemis-stomp-protocol]. Adding protocol
support for: STOMP
2018-05-11 10:19:23,626 INFO  [org.apache.activemq.artemis.core.server]
AMQ221034: Waiting indefinitely to obtain live lock
2018-05-11 10:19:23,627 INFO  [org.apache.activemq.artemis.core.server]
AMQ221035: Live Server Obtained live lock
2018-05-11 10:19:34,878 ERROR [org.apache.activemq.artemis.core.server]
AMQ224000: Failure in initialisation: java.lang.NullPointerException
at
org.apache.activemq.artemis.core.paging.cursor.impl.PageSubscriptionImpl.installTXCallback(PageSubscriptionImpl.java:848)
[artemis-server-2.5.0.jar:2.5.0]
at
org.apache.activemq.artemis.core.paging.cursor.impl.PageSubscriptionImpl.reloadPreparedACK(PageSubscriptionImpl.java:582)
[artemis-server-2.5.0.jar:2.5.0]
at
org.apache.activemq.artemis.core.persistence.impl.journal.AbstractJournalStorageManager.loadPreparedTransactions(AbstractJournalStorageManager.java:1774)
[artemis-server-2.5.0.jar:2.5.0]
at
org.apache.activemq.artemis.core.persistence.impl.journal.AbstractJournalStorageManager.loadMessageJournal(AbstractJournalStorageManager.java:1169)
[artemis-server-2.5.0.jar:2.5.0]
at
org.apache.activemq.artemis.core.server.impl.ActiveMQServerImpl.loadJournals(ActiveMQServerImpl.java:2588)
[artemis-server-2.5.0.jar:2.5.0]
at
org.apache.activemq.artemis.core.server.impl.ActiveMQServerImpl.initialisePart2(ActiveMQServerImpl.java:2346)
[artemis-server-2.5.0.jar:2.5.0]
at
org.apache.activemq.artemis.core.server.impl.LiveOnlyActivation.run(LiveOnlyActivation.java:71)
[artemis-server-2.5.0.jar:2.5.0]
at
org.apache.activemq.artemis.core.server.impl.ActiveMQServerImpl.internalStart(ActiveMQServerImpl.java:522)
[artemis-server-2.5.0.jar:2.5.0]
at
org.apache.activemq.artemis.core.server.impl.ActiveMQServerImpl.start(ActiveMQServerImpl.java:461)
[artemis-server-2.5.0.jar:2.5.0]
at
org.apache.activemq.artemis.integration.FileBroker.start(FileBroker.java:111)
[artemis-cli-2.5.0.jar:2.5.0]
at org.apache.activemq.artemis.cli.commands.Run.execute(Run.java:82)
[artemis-cli-2.5.0.jar:2.5.0]
at
org.apache.activemq.artemis.cli.Artemis.internalExecute(Artemis.java:149)
[artemis-cli-2.5.0.jar:2.5.0]
at org.apache.activemq.artemis.cli.Artemis.execute(Artemis.java:97)
[artemis-cli-2.5.0.jar:2.5.0]
at org.apache.activemq.artemis.cli.Artemis.execute(Artemis.java:124)
[artemis-cli-2.5.0.jar:2.5.0]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[rt.jar:1.8.0_151]
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
[rt.jar:1.8.0_151]
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[rt.jar:1.8.0_151]
at java.lang.reflect.Method.invoke(Method.java:498)
[rt.jar:1.8.0_151]
at
org.apache.activemq.artemis.boot.Artemis.execute(Artemis.java:129)
[artemis-boot.jar:2.5.0]
at org.apache.activemq.artemis.boot.Artemis.main(Artemis.java:49)
[artemis-boot.jar:2.5.0]

What is it about?

Thanks,
Archibald



--
Sent from: http://activemq.2283324.n4.nabble.com/ActiveMQ-User-f2341805.html


Re: [ARTEMIS] Clustered broker with multiple live servers and shared JDBC-Store

2018-04-26 Thread Archibald
@jbertram: 2.5.0



--
Sent from: http://activemq.2283324.n4.nabble.com/ActiveMQ-User-f2341805.html


Re: [ARTEMIS] Clustered broker with multiple live servers and shared JDBC-Store

2018-04-26 Thread Archibald
The more I search for answers by reading other threads the more I get the
impression, that the whole replication strategy only works on your test
cases (or single host) but not in a real clustered (multi host)
environment...

See 
http://activemq.2283324.n4.nabble.com/H-A-colocated-replication-environment-not-working-as-expected-td4719539.html
or 
http://activemq.2283324.n4.nabble.com/Artemis-2-5-0-Problems-with-colocated-scaledown-td4737583.html





--
Sent from: http://activemq.2283324.n4.nabble.com/ActiveMQ-User-f2341805.html


Re: [ARTEMIS] Clustered broker with multiple live servers and shared JDBC-Store

2018-04-26 Thread Archibald
  [org.apache.activemq.artemis.core.server]
AMQ221066: Initiating quorum vote: RequestBackupQuorumVote
2018-04-26 06:57:27,294 INFO  [org.apache.activemq.artemis.core.server]
AMQ221060: Sending quorum vote request to 10.0.1.109/10.0.1.109:61616:
RequestBackupVote [backupsSize=-1, nodeID=null, backupAvailable=false]
2018-04-26 06:57:27,297 INFO  [org.apache.activemq.artemis.core.server]
AMQ221061: Received quorum vote response from 10.0.1.109/10.0.1.109:61616:
RequestBackupVote [backupsSize=1,
nodeID=36502b14-491e-11e8-9a28-0242ac120006, backupAvailable=false]

The whole scenario only stablizis if I restart the first server aswell (but
I doubt that it will recover from backup, instead it will ask the second
server for a new backup).

Why does colocation doesnt't work here? Is this a configuration issue?

A short notice. The whole scenario runs on docker. So after a restart each
server gets a new IP address. 
This issue looks similar to what Ikka described in
http://activemq.2283324.n4.nabble.com/Artemis-2-5-0-Problems-with-colocated-scaledown-td4737583.html
but has never been commented and in my scenario it doesn't matter wether I
use UDP broadcasts or static connectors.

Thank you for any help,

Archibald



--
Sent from: http://activemq.2283324.n4.nabble.com/ActiveMQ-User-f2341805.html


Re: [ARTEMIS] Clustered broker with multiple live servers and shared JDBC-Store

2018-04-24 Thread Archibald
Hi Justin,

what I understood from the documentation is that with the scale-down option
it should very well be possible to offload the current work to another live
server (in case of normal shutdown, of course). Or am I wrong?

And how's scaled down interally handled? A client currently connected to a
live server is being notified that this server is going down and which
server will take up the work. By what? The connector-ref definition in some
cluster configuration (which might not be public accessable at all)? Or the
public acceptor definition of the target server? 

If I now change the environment to one live and one backup server with a
shared storage (jdbc), what happens to current transactions/messages in
progress if I shutdown (not abort) the live server?
Will those be migrated to the backup server? What happens to messages which
are not marked as PERSISTENT?

Sorry for bothering with so many questions. But clustering is (was never)
easy to implement...

Br, 
A.



--
Sent from: http://activemq.2283324.n4.nabble.com/ActiveMQ-User-f2341805.html


Re: [ARTEMIS] Clustered broker with multiple live servers and shared JDBC-Store

2018-04-24 Thread Archibald
@MichelAndrePearce

That's a valid question. And the answer is more or less politically driven.
If you break down a monolith application which does everything in one
transaction people are getting nervious about their data. Keeping messages
within a database (which itself is also clustered and there's global
confidence, etc) keep other's calm as you can always see, nothing is lost.
See your data (in form of messages) is still persistent. We're running the
brokers in some docker environment where containers (or even nodes) go up
and down. And there's no confidence about the data being stored locally on
some nodes.

One the other hand without a database it is way easier to create (configure)
an elastic cluster of brokers...

Thanks A.  



--
Sent from: http://activemq.2283324.n4.nabble.com/ActiveMQ-User-f2341805.html


Re: [ARTEMIS] Clustered broker with multiple live servers and shared JDBC-Store

2018-04-24 Thread Archibald
Hi Franz, 

I just checked the artemis-configuration.xsd and you're right! There's a
node-manager-store-table-name specified. I was missing that in the latest
documentation about the jdbc-store. So I can have multiple tables for each
broker and a shared set of tables for bindings and messages?

If have 3 live servers running in one cluster which do load balancing, HA,
etc. Do I really need backup servers?
If one is down, I suspect the two others to take over message processing...

Thanks, A.



--
Sent from: http://activemq.2283324.n4.nabble.com/ActiveMQ-User-f2341805.html


[ARTEMIS] Clustered broker with multiple live servers and shared JDBC-Store

2018-04-24 Thread Archibald
Hi, 

I'm trying to create an environment with 3 live servers and a shared
JDBC-Store.
But this obviously failes due to live locks (all are using the same
NODE_MANAGER_STORE table).

So first server starts fine.
Second doesn't (timeout waiting for live lock).
Third doesn't (timeout waiting for live lock).

Is there a way to run this scenario successfully?

Thanks, 
Archibald.



--
Sent from: http://activemq.2283324.n4.nabble.com/ActiveMQ-User-f2341805.html


Re: MessageGroup behavior

2018-03-01 Thread Archibald
Agree.
Sorry for that.

Br, A.



--
Sent from: http://activemq.2283324.n4.nabble.com/ActiveMQ-User-f2341805.html


Re: MessageGroup behavior

2018-03-01 Thread Archibald
Even if, would not make any difference in my case.
The topic consumer is the broker itself by diverting messages into queues.

But each queue has multiple consumers which process messages concurrently...



--
Sent from: http://activemq.2283324.n4.nabble.com/ActiveMQ-User-f2341805.html


Re: MessageGroup behavior

2018-03-01 Thread Archibald
I'm struggling with a similiar problem:

I have one producer sending event messages. 
I have a couple of different consumers which shall react on those events.
Producer is not aware of any consumers and as such publishes events to a
topic.
The broker is configured with diverts which split and forward events to
dedicated consumer queues.

Those events are related to an asset and I want the consumers to process
events for the same asset one by one.

First try:
Producers uses JMSXGroupID on the message being send to the topic. But the
message is only being delivered to one of the consumer queues (and one
particular consumer).

Second try:
The producer sends message without JMSXGroupID. I've configured a
transformer on each divert which adds the JMSXGroupID property. But it seems
that at this stage the property is being ignored by Artemis.

What can I do?

Thanks, 
Archibald  



--
Sent from: http://activemq.2283324.n4.nabble.com/ActiveMQ-User-f2341805.html


Re: ApacheMQ Artemis JCA Adapter

2018-02-28 Thread Archibald
This one?

https://mvnrepository.com/artifact/org.apache.activemq.examples.modules/artemis-rar/2.4.0

Br, Archibald



--
Sent from: http://activemq.2283324.n4.nabble.com/ActiveMQ-User-f2341805.html


Re: Artemis and RESTeasy jar files

2018-02-26 Thread Archibald
One issue might be an incorrect build of artemis-rest.war.

The war does not contain any server libs as described in 
https://activemq.apache.org/artemis/docs/latest/rest.html

Quote:
http://maven.apache.org/POM/4.0.0;
   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance;
   xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd;>

   4.0.0
   org.somebody
   artemis-rest
   war
   My App
   1.0-SNAPSHOT

   
  
 org.apache.activemq.rest
 artemis-rest
 $VERSION
 

   *
   *

 
  
   




--
Sent from: http://activemq.2283324.n4.nabble.com/ActiveMQ-User-f2341805.html


Re: Artemis and RESTeasy jar files

2018-02-23 Thread Archibald
What i meant, is if you publish the rest war under "artemis-rest" using
 

you should therefor call 
http://10.141.65.248:8080/artemis-rest/queues
instead of 
http://10.141.65.248:8080/activemq-rest/queues

Br, A.



--
Sent from: http://activemq.2283324.n4.nabble.com/ActiveMQ-User-f2341805.html


Re: Artemis and RESTeasy jar files

2018-02-21 Thread Archibald
Your configuration reads:


You should try 
http://10.141.65.248:8080/artemis-rest/queues
accordingly.

Br, 
Archibald



--
Sent from: http://activemq.2283324.n4.nabble.com/ActiveMQ-User-f2341805.html


Re: [ARTEMIS-2.4] Unable to copy text from console's editor

2018-02-09 Thread Archibald
Hi, 

Can anyone confirm, that "copy to clipboard" is broken?

Thanks, A.



--
Sent from: http://activemq.2283324.n4.nabble.com/ActiveMQ-User-f2341805.html


Re: [ARTEMIS-2.4] Unable to copy text from console's editor

2018-02-07 Thread Archibald
Like this one?

 



--
Sent from: http://activemq.2283324.n4.nabble.com/ActiveMQ-User-f2341805.html


[ARTEMIS-2.4] Unable to copy text from console's editor

2018-02-07 Thread Archibald
Hi all, 

I'm running Artemis 2.4 with console enabled. Security settings allow
connection from any host.
However I am not able to copy any text from the console's editor. For
example if I browse the DLQ I see undelivered messages being listed in a
kind of (disabled) editor. 
Why is it not possible (allowed) to copy text from here? E.g. I want to copy
the msg id to submit a retry command.
Even the "Copy value to clipboard" does not copy anything.
BTW: Chrome explicitly shows a disabled context menu entry. FF's entry is
not disabled.

Can someone enlight me?

Thanks, A.



--
Sent from: http://activemq.2283324.n4.nabble.com/ActiveMQ-User-f2341805.html


Re: [ARTEMIS 2.4] Question: Message grouping and selectors

2018-01-31 Thread Archibald
Thanks for the explanation, 

my workaround is to have only one consumer without selector and delegate
accordingly in the onMessage() method.

I was just wondering whether this behaviour is done-by-design or should
potentially work.

Br, A.



--
Sent from: http://activemq.2283324.n4.nabble.com/ActiveMQ-User-f2341805.html


[ARTEMIS 2.4] Question: Message grouping and selectors

2018-01-30 Thread Archibald
Dear experts, 

Assume you have a JMS queue Q with two consumers A and B using message
selectors.
A listens on messages having country='US'.
B listens on messages having country='Canada'.

A producer C sents subsequently messages to Q with either country='US' or
country='Canada' as property and a message grouping property 'JMSXGroupID'
with a single fixed id.

My observation is now that consumer A gets messages with country='US', but B
doesn't get anything. Messages which country='Canada' are stuck in the
queue.

It seems that the broker tries to forward all messages to Consumer A because
of message grouping and does not respect selectors.

Is this a "Don't do it. This is not way it is intented to work." thing?

Thanks for clarifying, 
A.



--
Sent from: http://activemq.2283324.n4.nabble.com/ActiveMQ-User-f2341805.html


Re: [ARTEMIS] A diverted message cannot be retried from DLQ

2018-01-30 Thread Archibald
See also: https://issues.apache.org/jira/browse/ARTEMIS-1645.



--
Sent from: http://activemq.2283324.n4.nabble.com/ActiveMQ-User-f2341805.html


Re: [ARTEMIS] A diverted message cannot be retried from DLQ

2018-01-30 Thread Archibald
Yes, I stumbled across this issue running 2.4.0. But wrote a test against
master.

Br, A.



--
Sent from: http://activemq.2283324.n4.nabble.com/ActiveMQ-User-f2341805.html


Re: [ARTEMIS] Server doesn't start if JDBC store is used and table NODE_MANAGER_STORE is empty

2018-01-28 Thread Archibald
Thanks Franz, 

See my changes in PR #1822.

Br, A.



--
Sent from: http://activemq.2283324.n4.nabble.com/ActiveMQ-User-f2341805.html


Re: [ARTEMIS] Server doesn't start if JDBC store is used and table NODE_MANAGER_STORE is empty

2018-01-27 Thread Archibald
Thanks Franz, 

this sounds all supi-dupi interesting but has nothing to with the issue. 
It is as simple as I noticed.
>From the code:

JdbcSharedStateManager.java:
protected void createSchema() throws SQLException {
  try {
 createTable(sqlProvider.createNodeManagerStoreTableSQL(),
sqlProvider.createNodeIdSQL(), sqlProvider.createStateSQL(),
sqlProvider.createLiveLockSQL(), sqlProvider.createBackupLockSQL());
  } catch (SQLException e) {
 //no op: if a table already exists is not a problem in this case,
the prepareStatements() call will fail right after it if the table is not
correctly initialized
 if (logger.isDebugEnabled()) {
logger.debug("Error while creating the schema of the JDBC shared
state manager", e);
 }
  }
   }

Obviously here the table is being created along with some other initial data
import.

Then later in AbstractJDBCDriver.java:

private static void createTableIfNotExists(Connection connection,
  String tableName,
  String... sqls) throws
SQLException {
  logger.tracef("Validating if table %s didn't exist before creating",
tableName);
  try {
 connection.setAutoCommit(false);
 try (ResultSet rs = connection.getMetaData().getTables(null, null,
tableName, null)) {
if (rs != null && !rs.next()) {
   if (logger.isTraceEnabled()) {
  logger.tracef("Table %s did not exist, creating it with
SQL=%s", tableName, Arrays.toString(sqls));
   }
   final SQLWarning sqlWarning = rs.getWarnings();
   if (sqlWarning != null) {
  logger.warn(JDBCUtils.appendSQLExceptionDetails(new
StringBuilder(), sqlWarning));
   }
   try (Statement statement = connection.createStatement()) {
  for (String sql : sqls) {
 statement.executeUpdate(sql);
 final SQLWarning statementSqlWarning =
statement.getWarnings();
 if (statementSqlWarning != null) {
logger.warn(JDBCUtils.appendSQLExceptionDetails(new
StringBuilder(), statementSqlWarning, sql));
 }
  }
   }
}
 }
 connection.commit();
 ...

So if table exists, don't do anything. If it doesn't exist, fill with
initial data.

This implementation could be improved by the case where the table exists,
but is empty which should lead to the same initial setup as the case where
the table does not exist.

Can this be fixed? 

Thanks, 
Archibald



--
Sent from: http://activemq.2283324.n4.nabble.com/ActiveMQ-User-f2341805.html


Re: [ARTEMIS] A diverted message cannot be retried from DLQ

2018-01-27 Thread Archibald
Before someone asks: I ran the test against current master.



--
Sent from: http://activemq.2283324.n4.nabble.com/ActiveMQ-User-f2341805.html


Re: [ARTEMIS] A diverted message cannot be retried from DLQ

2018-01-27 Thread Archibald
Hmm, don't know why the original mail message text is no being posted here
but only the attachment,
but anyway here it is again:

Given a topic SOURCE and a divert which forwards a message M to a queue
TARGET.
Consumer fails to process M and M is being send to DLQ.
 
If you now retry M from DLQ it is not send to TARGET but you'll get
AMQ222196: Could not find binding ...
And even worse the message is lost afterwards...
 
My suspecion is, that the message properties are not correct regarding
_AMQ_ORIG_ADDRESS and _AMQ_ORIG_QUEUE.
Is: _AMQ_ORIG_ADDRESS=, _AMQ_ORIG_QUEUE=TARGET
Should be:  _AMQ_ORIG_ADDRESS=, _AMQ_ORIG_QUEUE=TARGET
 
Attached you'll find a testcase "testRetryDivertedMessage" which
demonstrates the problem.
 
Can this be fixed? a) Retry should be possible. b) If not do not remove
message.

Br, Archibald



--
Sent from: http://activemq.2283324.n4.nabble.com/ActiveMQ-User-f2341805.html


[ARTEMIS] A diverted message cannot be retried from DLQ

2018-01-27 Thread Archibald Whilshire
/*
 * 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.tests.integration.management;

import static 
org.apache.activemq.artemis.core.management.impl.openmbean.CompositeDataConstants.BODY;

import java.util.HashMap;
import java.util.LinkedList;
import java.util.Map;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.TimeUnit;

import javax.json.JsonArray;
import javax.json.JsonObject;
import javax.management.Notification;
import javax.management.openmbean.CompositeData;

import org.apache.activemq.artemis.api.core.ActiveMQException;
import org.apache.activemq.artemis.api.core.JsonUtil;
import org.apache.activemq.artemis.api.core.Message;
import org.apache.activemq.artemis.api.core.RoutingType;
import org.apache.activemq.artemis.api.core.SimpleString;
import org.apache.activemq.artemis.api.core.client.ClientConsumer;
import org.apache.activemq.artemis.api.core.client.ClientMessage;
import org.apache.activemq.artemis.api.core.client.ClientProducer;
import org.apache.activemq.artemis.api.core.client.ClientSession;
import org.apache.activemq.artemis.api.core.client.ClientSessionFactory;
import org.apache.activemq.artemis.api.core.client.MessageHandler;
import org.apache.activemq.artemis.api.core.client.ServerLocator;
import org.apache.activemq.artemis.api.core.management.ActiveMQServerControl;
import org.apache.activemq.artemis.api.core.management.CoreNotificationType;
import org.apache.activemq.artemis.api.core.management.DayCounterInfo;
import org.apache.activemq.artemis.api.core.management.MessageCounterInfo;
import org.apache.activemq.artemis.api.core.management.ObjectNameBuilder;
import org.apache.activemq.artemis.api.core.management.QueueControl;
import org.apache.activemq.artemis.core.config.Configuration;
import org.apache.activemq.artemis.core.config.DivertConfiguration;
import 
org.apache.activemq.artemis.core.messagecounter.impl.MessageCounterManagerImpl;
import org.apache.activemq.artemis.core.server.ActiveMQServer;
import org.apache.activemq.artemis.core.server.ActiveMQServers;
import org.apache.activemq.artemis.core.server.Queue;
import org.apache.activemq.artemis.core.settings.impl.AddressSettings;
import 
org.apache.activemq.artemis.tests.integration.jms.server.management.JMSUtil;
import org.apache.activemq.artemis.utils.Base64;
import org.apache.activemq.artemis.utils.RandomUtil;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;

public class QueueControlTest extends ManagementTestBase {

   private ActiveMQServer server;
   private ClientSession session;
   private ServerLocator locator;

   @Test
   public void testAttributes() throws Exception {
  SimpleString address = RandomUtil.randomSimpleString();
  SimpleString queue = RandomUtil.randomSimpleString();
  SimpleString filter = new SimpleString("color = 'blue'");
  boolean durable = RandomUtil.randomBoolean();

  session.createQueue(address, queue, filter, durable);

  QueueControl queueControl = createManagementControl(address, queue);
  Assert.assertEquals(queue.toString(), queueControl.getName());
  Assert.assertEquals(address.toString(), queueControl.getAddress());
  Assert.assertEquals(filter.toString(), queueControl.getFilter());
  Assert.assertEquals(durable, queueControl.isDurable());
  Assert.assertEquals(false, queueControl.isTemporary());

  session.deleteQueue(queue);
   }

   @Test
   public void testGetNullFilter() throws Exception {
  SimpleString address = RandomUtil.randomSimpleString();
  SimpleString queue = RandomUtil.randomSimpleString();

  session.createQueue(address, queue, null, false);

  QueueControl queueControl = createManagementControl(address, queue);
  Assert.assertEquals(queue.toString(), queueControl.getName());
  Assert.assertEquals(null, queueControl.getFilter());

  session.deleteQueue(queue);
   }

   @Test
   public void testGetDeadLetterAddress() throws Exception {
  SimpleString address = RandomUtil.randomSimpleString();
  SimpleString queue = RandomUtil.randomSimpleString();
  final SimpleString deadLetterAddress = 

Re: [ARTEMIS] Server doesn't start if JDBC store is used and table NODE_MANAGER_STORE is empty

2018-01-26 Thread Archibald
And I can see that the broker is holding a lock on that table. So it tries to
insert something which fails but does not properly rollback...



--
Sent from: http://activemq.2283324.n4.nabble.com/ActiveMQ-User-f2341805.html


Re: [ARTEMIS] Server doesn't start if JDBC store is used and table NODE_MANAGER_STORE is empty

2018-01-26 Thread Archibald
Hi Franz, 

to your questions:
1) Oracle Database 12c Standard Edition Release 12.2.0.1.0 - 64bit
Production
2) not more is being written to the log (not even in debug)
3) no I haven't tried the latest master. But since I do not find a related
issue in JIRA I assume that it still exist.

BTW: I currenty own the required grants since oracle is running on my own
laptop. But I know that this will cause trouble when installing Artemis in
our production environment.

HTH,
Archibald



--
Sent from: http://activemq.2283324.n4.nabble.com/ActiveMQ-User-f2341805.html


Re: [ARTEMIS] Server doesn't start if JDBC store is used and table NODE_MANAGER_STORE is empty

2018-01-26 Thread Archibald
Thanks Franz, 

the other tables do work pretty well if they already exist but are empty. It
is just the NODE_MANAGE_STORE which somehow "picky"...

Br,
Archibald 



--
Sent from: http://activemq.2283324.n4.nabble.com/ActiveMQ-User-f2341805.html


[ARTEMIS] Server doesn't start if JDBC store is used and table NODE_MANAGER_STORE is empty

2018-01-26 Thread Archibald
Hi all, 

2.4.0 introduced a new table NODE_MANAGER_STORE. This table is being created
on startup if it doesn't exist.
But if it does exist but is empty server fails to start (seen on a oracle
database) with

08:43:20,510 INFO  [org.apache.activemq.artemis.integration.bootstrap]
AMQ101000: Starting ActiveMQ Artemis Server
activemq_1  | can't write NODE_ID on the JDBC Node Manager Store!

The issue is that the database user it is not always allowed (has the proper
grants) to create/modify a schema. 

Can this be fixed?

Thanks, 
Archibald



--
Sent from: http://activemq.2283324.n4.nabble.com/ActiveMQ-User-f2341805.html


Re: [ARTEMIS] DLQ: retryMessages()

2018-01-24 Thread Archibald
Sorry, i forgot to mention. I am currently running Artemis 2.4.0.

What kind of test do you expect? It should be reproduceable with any DLQ
containing more than 1 message.
The user's test is to invoke the method above from queue's operations list
in the admin console.

HTH,
Archibald



--
Sent from: http://activemq.2283324.n4.nabble.com/ActiveMQ-User-f2341805.html


Re: [ARTEMIS] DLQ: retryMessages()

2018-01-24 Thread Archibald
BTW: A single message issued with retryMessage() works.



--
Sent from: http://activemq.2283324.n4.nabble.com/ActiveMQ-User-f2341805.html


[ARTEMIS] DLQ: retryMessages()

2018-01-24 Thread Archibald
Hi all, 

when launch the retryMessages() command from the Artemis console on the DLQ
I only get:

java.lang.ClassCastException : [B cannot be cast to [Ljava.langObject;

Nothing like that is shown in the broker's log. So I assume it is something
in hawtio?

Can this be fixed? This function is one of the most important ones.

Br, 
Archibald



--
Sent from: http://activemq.2283324.n4.nabble.com/ActiveMQ-User-f2341805.html


Re: [ARTEMIS] ActiveMQScheduledLeaseLock warning is written periodically in broker log since 2.4.0

2018-01-17 Thread Archibald
Awesome, thank you!

Br, Archibald



--
Sent from: http://activemq.2283324.n4.nabble.com/ActiveMQ-User-f2341805.html


Re: [ARTEMIS] Message not being consumed from queue which came from topic using divert and selector expression

2018-01-12 Thread Archibald
Thanks Justin, 

with the fix in ARTEMIS-1508 the issue is also gone for in my case.

Br, Archibald



--
Sent from: http://activemq.2283324.n4.nabble.com/ActiveMQ-User-f2341805.html


Re: [ARTEMIS] Message not being consumed from queue which came from topic using divert and selector expression

2018-01-11 Thread Archibald
The issue occurs only, if the original message is being sent via AMQP (the
receiver itself is a JMS-Consumer). If I use a JMS Producer everything works
as expected.

Br, Archibald



--
Sent from: http://activemq.2283324.n4.nabble.com/ActiveMQ-User-f2341805.html


[ARTEMIS] Message not being consumed from queue which came from topic using divert and selector expression

2018-01-11 Thread Archibald
Hi all, 

I stumbled on an issue which looks similar to  ARTEMIS-1508
<https://issues.apache.org/jira/browse/ARTEMIS-1508>   using version 2.4.0.
The setup is the very same:
A  is used to route messages from a topic to a queue, and a consumer
is attached to the target queue using a selector expression. 
Message is not being consumed and broker log reads:



Any help on this?

Thanks, Archibald



--
Sent from: http://activemq.2283324.n4.nabble.com/ActiveMQ-User-f2341805.html


Artemis' Rest Interface Authentication

2017-11-01 Thread Archibald
Hi, 

I've the Artemis (2.3) running with the embedded Jetty server. The server is
using JAAS authentication. I've also deployed a rest.war as described in the
documentation.

I understand that security must be handled by the war itself (e.g.
ServletFilter) as no credentials passed with a request are forwarded to the
artemis server. In fact all calls to the server within the provided rest.jar
are without any authentication information which lets my server to refuse
all requests. My rest.war is configured to use the InVM transport to connect
to the server. I know I can change it to use netty transport but even then I
see no way to pass any credentials along with the call.

So how is rest supposed to work exactly?

Thanks for any clarification!

Archibald



--
Sent from: http://activemq.2283324.n4.nabble.com/ActiveMQ-User-f2341805.html