Delayed messages not appearing in queue while using rabbitmq_delayed_message_exchange - rabbitmq

I was trying to use this plugin and it seemed pretty simple and effective. I was able to create the exchange but when i am publishing a request, if there is a non zero x-delay value, i am unable to see the message being passed on the queue.(works fine with x-delay equals 0)
I am using pika and python; the following command was used to create the exchange:
channel.exchange_declare( exchange="central_exchange", exchange_type='x-delayed-message', passive=False, durable=False, auto_delete=False, internal=False, arguments=args )
for publishing the message:
channel.basic_publish(
exchange="central_exchange",
routing_key="my_queue",
body=message,
properties=pika.BasicProperties(headers={"x-delay": 5000})
)
Thanks for your help!

Looking at the logs, the plugin trying to run erlang files which were throwing errors.
It seems this plugin only supports Erlang/OTP 18.0 or later.
The standalone version of rabbitmq was bundled with erlang 17.5. had to install it using homebrew, updated erlang, now working like a charm!!
All thanks to michaelklishin (writer of plugin) for his help :)

Related

RabbitMQ management returns 500 when trying to list queues

I've just installed Erlang 19.0, then Rabbitmq Server 3.6.3. OS - Windows 10. Then I installed rabbitmq_management plugin, then I started rabbitmq-server. I can successfully login into management console. The problem is when I go to Queues I get as error:
Got response code 500 with body {"error":"JSON encode error:
{bad_term,#{error_logger => true,kill => true,size =>
0}}","reason":"While encoding: \n[{total_count,1},\n {item_count,1},\n
{filtered_count,1},\n {page,1},\n {page_size,100},\n {page_count,1},\n
{items,\n [[{memory,22048},\n {reductions,6633},\n
{reductions_details,[{rate,0.0}]},\n {messages,0},\n
{messages_details,[{rate,0.0}]},\n {messages_ready,0},\n
{messages_ready_details,[{rate,0.0}]},\n
{messages_unacknowledged,0},\n
{messages_unacknowledged_details,[{rate,0.0}]},\n
{idle_since,<<\"2016-07-08 20:55:04\">>},\n
{consumer_utilisation,''},\n {policy,''},\n
{exclusive_consumer_tag,''},\n {consumers,1},\n
{recoverable_slaves,''},\n {state,running},\n {reductions,6633},\n
{garbage_collection,\n [{max_heap_size,#{error_logger => true,kill =>
true,size => 0}},\n {min_bin_vheap_size,46422},\n
{min_heap_size,233},\n {fullsweep_after,65535},\n {minor_gcs,3}]},\n
{messages_ram,0},\n {messages_ready_ram,0},\n
{messages_unacknowledged_ram,0},\n {messages_persistent,0},\n
{message_bytes,0},\n {message_bytes_ready,0},\n
{message_bytes_unacknowledged,0},\n {message_bytes_ram,0},\n
{message_bytes_persistent,0},\n {head_message_timestamp,''},\n
{disk_reads,0},\n {disk_writes,0},\n {backing_queue_status,\n
{struct,\n [{mode,default},\n {q1,0},\n {q2,0},\n
{delta,[delta,undefined,0,undefined]},\n {q3,0},\n {q4,0},\n
{len,0},\n {target_ram_count,infinity},\n {next_seq_id,0},\n
{avg_ingress_rate,0.0},\n {avg_egress_rate,0.0},\n
{avg_ack_ingress_rate,0.0},\n {avg_ack_egress_rate,0.0}]}},\n
{node,'rabbit#DESKTOP-330SD1I'},\n {arguments,{struct,[]}},\n
{exclusive,false},\n {auto_delete,false},\n {durable,true},\n
{vhost,<<\"/\">>},\n {name,<<\"queue1\">>}]]}]"}
If I remove from myself a privilegy to access "/" virtual host error disappears, but no queues are shown, which I suppose is wrong, because I have a running application which sends and reveives messages.
Here is the closest question to my, but those solution doesn't help.
P.S. I don't even hope somebody help me, I just wanted to post this question so at least this error can be googled.
there are some known issues with Erlang 19, discussed in the RMQ Google Group, here.
In other words, 3.6.3 effectively isn't Erlang 19.0-compatible:
you'll need to install a prior version of Erlang, until RMQ can be re-built to support the changes in Erlang 19
I've installed Erlang OTP 18.0 and RabbitMq 3.6.3 management console started to work fine. Before I tried to use OTP 19.0 and I got errors during browsing web-console.
I upgraded RabbitMQ to 3.6.5 and the error got resolved. It is now working with Erlang 19.0.

Erlang can't connect to any HTTPS url

The problem arose when I was trying to build rebar3, but it couldn't fetch its dependencies from Amazon S3. Debugging into the problem I found out that the erlang runtime couldn't connect to any HTTPS site, although curl or wget work completely fine. When I set httpc:set_options([{verbose,trace}]), I get the following output:
{failed_connect,
[{to_address,{"s3.amazonaws.com",443}},
{inet,
[inet],
{eoptions,
{undef,
[{ssl,connect,
["s3.amazonaws.com",443,
[binary,
{active,false},
{ssl_imp,new},
inet],
20000],
[]},
{http_transport,connect,4,
[{file,"http_transport.erl"},{line,135}]},
{httpc_handler,connect,4,
[{file,"httpc_handler.erl"},{line,891}]},
{httpc_handler,
connect_and_send_first_request,3,
[{file,"httpc_handler.erl"},{line,905}]},
{httpc_handler,init,1,
[{file,"httpc_handler.erl"},{line,242}]},
{proc_lib,init_p_do_apply,3,
[{file,"proc_lib.erl"},{line,239}]}]}}}]}
Where can I look to find out what the problem is ?
You are missing the ssl Erlang application. Some Linux distributions split Erlang into several subpackages. You should make sure that you have the package erlang-ssl installed on your system.

java.lang.NoClassDefFoundError: Could not initialize class org.apache.activemq.util.IdGenerator

I am trying to use ActiveMQ 5.10.0 with SoapUI 4.6 and Hermes 1.14. I get the error below when I try and add a queue. I presume Hermes can't find the type IdGenerator in any of the loaded jars. Which are:
activemq-client-5.10.0.jar
geronimo-j2ee-management_1.1_spec-1.0.1.jar
geronimo-jms_1.1_spec-1.1.1.jar
Does anyone know where this class is defined? I looked for activemq-util.jar in the binary distribution but I did not find such a file.
Error:
java.lang.NoClassDefFoundError: Could not initialize class org.apache.activemq.util.IdGenerator
at org.apache.activemq.ActiveMQConnectionFactory.getClientIdGenerator(ActiveMQConnectionFactory.java:969)
at org.apache.activemq.ActiveMQConnectionFactory.createActiveMQConnection(ActiveMQConnectionFactory.java:363)
at org.apache.activemq.ActiveMQConnectionFactory.createActiveMQConnection(ActiveMQConnectionFactory.java:331)
at org.apache.activemq.ActiveMQConnectionFactory.createActiveMQConnection(ActiveMQConnectionFactory.java:303)
at org.apache.activemq.ActiveMQConnectionFactory.createQueueConnection(ActiveMQConnectionFactory.java:260)
at hermes.impl.jms.ConnectionManagerSupport.createConnection(ConnectionManagerSupport.java:147)
at hermes.impl.jms.ConnectionManagerSupport.createConnection(ConnectionManagerSupport.java:92)
at hermes.impl.jms.ConnectionSharedManager.reconnect(ConnectionSharedManager.java:81)
at hermes.impl.jms.ConnectionSharedManager.connect(ConnectionSharedManager.java:91)
at hermes.impl.jms.ConnectionSharedManager.getConnection(ConnectionSharedManager.java:104)
at hermes.impl.jms.ConnectionSharedManager.getObject(ConnectionSharedManager.java:142)
at hermes.impl.jms.ThreadLocalSessionManager.connect(ThreadLocalSessionManager.java:190)
at hermes.impl.jms.ThreadLocalSessionManager.getSession(ThreadLocalSessionManager.java:570)
at hermes.impl.jms.AbstractSessionManager.getDestination(AbstractSessionManager.java:460)
at hermes.impl.DefaultHermesImpl.getDestination(DefaultHermesImpl.java:367)
at hermes.browser.tasks.BrowseDestinationTask.invoke(BrowseDestinationTask.java:141)
at hermes.browser.tasks.TaskSupport.run(TaskSupport.java:175)
at hermes.browser.tasks.ThreadPool.run(ThreadPool.java:170)
at java.lang.Thread.run(Unknown Source)
This is very old but in case anyone else is trying to get this spun up... don't use the built in HermesJMS that comes with SoapUI. Apparently there's a bug in it that doesn't play nice with ActiveMQ v5.8 and following [I tried 5.11 & 5.13 and had the issue. The cheating fix is to install the standalone [I had to get it from sourceforge].
The sourceforge jar is installed with [assuming version 1.14]: java -jar hermes-installer-1.14.jar
Once installed you can tie this version to soapui or launch it with the bat/sh file. I still had issues with ActiveMQ version 5.13 but version 5.11 worked for me.
The IdGenerator class is located in the activemq-client jar. Here is the result of a search in the source tree:
/activemq-client/src/main/java/org/apache/activemq/util/IdGenerator.java
There's been no recent changes so I'd guess that the error is misleading and that it's actually some other missing dependency that's being loaded when the class is created. Is there more information in the log or a 'caused by exception' ?
For whom it may interest. This is kind of common issue I come accross from time to time. I call it jar version incompatibility. I was getting exception in title and other funny exceptions when using latest (but not actively developed) hermes 1.14 and currently latest Apache Active MQ 5.14. I've found out after a long struggle that it is fixed by using an older version of Active MQ - like 5.3.

Eclipse-Kepler, Java 8 compilation issue "syntax errors on tokens"

I am using Eclipse Kepler with jdk1.8.0.
I do not face any compilation problems in import statements related to java8 or collect construct. However I get the compilation issue in:- Dish::getName...it says.. Syntax errors on tokens, delete the tokens.
Just trying to run the following code:
List<String> dishNames = menu.stream()
.map(Dish::getName)
.collect(toList());
System.out.println(dishNames);
Dish is a java object with String property name.
I have installed JDK8, added the latest JRE in eclipse Java Build Path.
Java compiler compliance.
Any hints what something silly I am missing?
I think you missed installing support of java8 in eclipse kepler.
You can follow this link for detailed instructions.
https://wiki.eclipse.org/JDT/Eclipse_Java_8_Support_For_Kepler

WARNING in Glassfish about JMS

I have recently installed the latest Glassfish open source version and configure it but I have problem with JMS and now my 2 Glassfish servers have problem (whereas before installing new GF server, it was working on the previous GF server). So I think there is probably conflict between these 2 servers.
When I try to use JMS, I receive these logs :
[#|2013-03-20T14:10:00.015+0100|FINE|glassfish3.1.2|javax.jms.ConnectionFactory.mqjmsra|_ThreadID=152;_ThreadName=Thread-2;ClassName=com.sun.messaging.jms.ra.DirectConnectionFactory;MethodName=createConnection;|MQJMSRA_DCF1101: createConnection():|#]
[#|2013-03-20T14:10:00.015+0100|FINE|glassfish3.1.2|javax.jms.ConnectionFactory.mqjmsra|_ThreadID=152;_ThreadName=Thread-2;ClassName=com.sun.messaging.jms.ra.DirectConnectionFactory;MethodName=createConnection;|MQJMSRA_DCF1101: createConnection(u,p):username=guest|#]
[#|2013-03-20T14:10:00.015+0100|FINE|glassfish3.1.2|javax.jms.Connection.mqjmsra|_ThreadID=152;_ThreadName=Thread-2;ClassName=com.sun.messaging.jms.ra.DirectConnection;MethodName=createSession;|MQJMSRA_DC1101: connectionId=7032438472106962688:createSession():isTransacted=false:acknowledgeMode=1|#]
[#|2013-03-20T14:10:00.015+0100|FINE|glassfish3.1.2|javax.jms.Session.mqjmsra|_ThreadID=152;_ThreadName=Thread-2;ClassName=com.sun.messaging.jms.ra.DirectSession;MethodName=close;|MQJMSRA_DS1101: sessionId=7032438472122322689:close()|#]
[#|2013-03-20T14:10:00.015+0100|FINE|glassfish3.1.2|javax.jms.Connection.mqjmsra|_ThreadID=152;_ThreadName=Thread-2;ClassName=com.sun.messaging.jms.ra.DirectConnection;MethodName=close;|MQJMSRA_DC1101: connectionId=7032438472106962688:close():|#]
[#|2013-03-20T14:10:00.046+0100|FINE|glassfish3.1.2|javax.jms.Connection.mqjmsra|_ThreadID=152;_ThreadName=Thread-2;ClassName=com.sun.messaging.jms.ra.DirectConnection;MethodName=_unsetClientID;|MQJMSRA_DC1101: connectionId=7032438472106962688:_unsetClientID():|#]
[#|2013-03-20T14:10:06.796+0100|FINE|glassfish3.1.2|javax.jms.ConnectionFactory.mqjmsra|_ThreadID=42;_ThreadName=Thread-2;ClassName=com.sun.messaging.jms.ra.DirectConnectionFactory;MethodName=createConnection;|MQJMSRA_DCF1101: createConnection():|#]
[#|2013-03-20T14:10:06.796+0100|FINE|glassfish3.1.2|javax.jms.ConnectionFactory.mqjmsra|_ThreadID=42;_ThreadName=Thread-2;ClassName=com.sun.messaging.jms.ra.DirectConnectionFactory;MethodName=createConnection;|MQJMSRA_DCF1101: createConnection(u,p):username=guest|#]
[#|2013-03-20T14:10:06.796+0100|FINE|glassfish3.1.2|javax.jms.Connection.mqjmsra|_ThreadID=42;_ThreadName=Thread-2;ClassName=com.sun.messaging.jms.ra.DirectConnection;MethodName=setExceptionListener;|MQJMSRA_DC1101: connectionId=7032438472106962688:setExceptionListener()|#]
[#|2013-03-20T14:10:06.796+0100|WARNING|glassfish3.1.2|javax.jms.Connection.mqjmsra|_ThreadID=42;_ThreadName=Thread-2;|MQJMSRA_DC2001: Unsupported:setExceptionListener():inACC=false:connectionId=7032438472106962688|#]
[#|2013-03-20T14:10:06.796+0100|FINE|glassfish3.1.2|javax.jms.Connection.mqjmsra|_ThreadID=42;_ThreadName=Thread-2;ClassName=com.sun.messaging.jms.ra.DirectConnection;MethodName=_unsetClientID;|MQJMSRA_DC1101: connectionId=7032438472106962688:_unsetClientID():|#]
I didn't find anything on Google...anybody to help me ?
The cause was a Java library deployed in ${GLASSFISH_HOME}/glassfish/domains/domain1/lib in Milestone state. Gone back to the latest release solved the problem.