I am running ActiveMQ 5.15.5 as a standalone broker and my spring application
is connecting to it.
I wanted to know if I can log the Task-ID that the broker logs, in the
client application logs.
Currently application logs look like:
INFO ] 2018-11-29 09:52:19,144 [ActiveMQ Session Task] ....
[INFO ] 2018-11-29 09:52:19,168 [ActiveMQ Session Task] ...
[INFO ] 2018-11-29 09:52:19,199 [ActiveMQ Session Task] ....
I believe if I had embedded activeMQ the logs would look like
INFO ] 2018-11-29 09:52:19,144 [ActiveMQ Session Task-9] ....
[INFO ] 2018-11-29 09:52:19,168 [ActiveMQ Session Task-9] ...
Looking at the client application logs, i do not have a way to categorize
transactions by multiple users as they are all logged as "ActiveMQ Session
Task"
Is there a way to log the Task-ID from broker (I do see the Task-ID at the
broker logs activemq.log) in the client logs.
I tried to set the ActiveMQ logs in the client log4j.xml to info with no
luck.
Thanks
The "Task-ID", as you call it, which is logged here is actually just the name of the thread on the broker which is performing the work. The client has no idea about the thread name on the broker and there is no way to communicate that information with the client. Those threads are pooled and re-used over & over so using their names to identify a unique transaction almost certainly wouldn't work anyway.
Related
I have want to connect 2 micro services java with c#, in my c# I have setup my rabbitmq and I am running my services on docker. I believe everything is setup correctly but when trying to send over a message I get an error telling me my event bus does not exist. Even though i can see that the event bus does infact exist on the rabbitmq localhost website.
Would anyone know what causes this and how i could fix this, thank you for your time and help.
my rabbitmq port:
"15672:15672"
"5672:5672"
I can go on my localhost:15672 and see my exchanges and queues on rabbitmq
Yet when I try to use the "ConvertAndSend" Methode in java I get this error:
2022-08-30 12:01:47.801 INFO 90768 --- [nio-8090-exec-1] o.s.a.r.c.CachingConnectionFactory : Attempting to connect to: [localhost:5672]
2022-08-30 12:01:48.100 INFO 90768 --- [nio-8090-exec-1] o.s.a.r.c.CachingConnectionFactory : Created new connection: rabbitConnectionFactory#1a1cc163:0/SimpleConnection#39d3d67d [delegate=amqp://guest#127.0.0.1:5672/, localP
ort= 56701]
2022-08-30 12:01:48.249 ERROR 90768 --- [ 127.0.0.1:5672] o.s.a.r.c.CachingConnectionFactory : Channel shutdown: channel error; protocol method: #method<channel.close>(reply-code=404, reply-text=NOT_FOUND - no exchange 'StudyP
lannerAndMonitor_event_bus' in vhost '/', class-id=60, method-id=40)
I have also let a friend try and run my code and he does not have the issue, everything seems to work fine with him.
ERROR org.apache.activemq.broker.BrokerService - Failed to start Apache ActiveMQ ([localhost, null], java.io.IOException: org/apache/activemq/store/NoLocalSubscriptionAware)
INFO org.apache.activemq.broker.BrokerService - Apache ActiveMQ 5.9.1 (localhost, null) is shutting down
INFO org.apache.activemq.broker.TransportConnector - Connector tcp://localhost:61616 stopped
WARN org.apache.activemq.broker.jmx.ManagementContext - Failed to start JMX connector Cannot bind to URL [rmi://localhost:1099/jmxrmi]: javax.naming.NameAlreadyBoundException: jmxrmi [Root exception is java.rmi.AlreadyBoundException: jmxrmi]. Will restart management to re-create JMX connector, trying to remedy this issue.
The code I am trying to use is
BrokerService broker = new BrokerService();
TransportConnector connector = new TransportConnector();
connector.setUri(new URI("tcp://localhost:61616"));
broker.addConnector(connector);
broker.start();
I am getting exception at start() method. I am deploying this on server not in my computer.
It's quite hard to say what is wrong given the limited information but one thing I'd check is that there isn't already a broker running on that server as it looks like something is at least sitting on the JMX port already. You could check in the broker log to see if the broker logs any additional information on the error.
I am having problems running an app I have developed in an EC2 instance. When I execute the .jar (java -jar app.jar), the SpringBoot app starts but it fails when trying to connect to my MySQL RDS database. The thing is when I run the app locally on my machine, It has no issues with the DB connection.
I have opened the port where the app is running (8090) and MySql port as well (3306) for inbound and outbound traffic:
This is the error I get:
2016-09-23 17:46:38.132 INFO 10161 --- [main] .t.TomcatEmbeddedServletContainerFactory : Server initialized with port: 8090
2016-09-23 17:46:38.604 INFO 10161 --- [main] o.apache.catalina.core.StandardService : Starting service Tomcat
2016-09-23 17:46:38.605 INFO 10161 --- [main] org.apache.catalina.core.StandardEngine : Starting Servlet Engine: Apache Tomcat/7.0.54
2016-09-23 17:46:38.724 INFO 10161 --- [ost startStop 1] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext
2016-09-23 17:46:38.725 INFO 10161 --- [ost startStop 1] o.s.web.context.ContextLoader: Root WebApplicationContext: initialization completed in 5028 ms
2016-09-23 17:48:48.476 ERROR 10161 --- [ost startStop 1] o.a.tomcat.jdbc.pool.ConnectionPool: Unable to create initial connections of pool.
com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure
The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.
Any ideas how can i solve this problem?
Thank you very much for your help
Regards
Andres
From your description and log file, it's likely that network configuration is the cause here.
You might want to draw the network topology of your instances (region/availability zone, VPC, subnet, network acl, security group). This will be very helpful when you do more complex development work.
There are good references: VPC Introduction and Security in your VPC and Scenarios for Accessing a DB Instance in a VPC
I suggest the following actions for your troubleshooting:
Check security group (SG) configuration of your EC2 instance and RDS instance.
You can check this by going to EC2 Dashboard/RDS Dashboard -> Click on an instance and look at "Security Group" description, or you can click on the Setting icon (Show/Hide columns) and tick "Security Groups".
In RDS's SG configuration: make sure you have enable access from EC2 instance's SG to port 3306. You can do this by putting EC2 instance's SG ID into Source field of the config, as a "Custom IP" value. See the 1st scenario in the above reference for more detail.
Use mysql command line to test the connection between EC2 instance and RDS.
Hope it helps.
You need to perform following steps :
1) Go to EC2 instance and find security group you want access in RDS
2) Now go to your RDS security group and select inbound rules
Select ALL TCP and add your sg-xxx(security group)
https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_VPC.Scenarios.html
I have configured two servers and one active mq server.
One server will send a JMS message and the Other server will receive the JMS messages from the active mq server.
Usually we will start active mq server and the servers one by one.
Now one of the server get's started successfully where as the other throws bind exception with 1099 as port already bind.
I have verified none of the process uses the port 1099.
Need a workaround if solution is not possible.
Exception stack trace
[Apr 10 09:58:37] [/] WARN org.apache.activemq.broker.jmx.ManagementContext
(JCLLoggerAdapter.java:359) - Failed to start jmx connector: Cannot bind to URL
[rmi://localhost:1099/jmxrmi]: javax.naming.NameAlreadyBoundException: jmxrmi [Root
exception is java.rmi.AlreadyBoundException: jmxrmi]
[Apr 10 09:58:37] [/] WARN org.apache.activemq.broker.jmx.ManagementContext
(JCLLoggerAdapter.java:359) - Failed to start jmx connector: Cannot bind to URL
[rmi://localhost:1099/jmxrmi]: javax.naming.NameAlreadyBoundException: jmxrmi [Root
exception is java.rmi.AlreadyBoundException: jmxrmi]
[Apr 10 09:58:37] [/] DEBUG org.apache.activemq.broker.jmx.ManagementContext
(JCLLoggerAdapter.java:245) - Reason for failed jms connector start
java.io.IOException: Cannot bind to URL [rmi://localhost:1099/jmxrmi]:
javax.naming.NameAlreadyBoundException: jmxrmi [Root exception is
java.rmi.AlreadyBoundException: jmxrmi]
at
Thanks.
As described by the provided stacktrace, both server have Remote JMX enabled on the same port. Use the -Dcom.sun.management.jmxremote.port=portNum option at the JVM level to tune the JMX port, or purely disable Remote JMX by removing the -Dcom.sun.management.jmxremote option. These options are usually located in ActiveMQ startup scripts.
I am using Camel to setup some routing using the file and jms-queue components. The problem that I am having is that I cannot disable polling messages sent to the console.
I tryed multiple ways to disable these messages by setting the logging level(runLoggingLevel = OFF) on the routes, trace = false on the context, set a logger on the routes and a few others but nothing works.
A message from the file component looks like this:
2013-08-26 09:34:47,651 DEBUG [Camel (camelContextOrder) thread #0 - file://order-import/order-in] o.a.c.c.f.FileConsumer Took 0.001 seconds to poll: order-import\order-in
And a messsage from the jms queue:
2013-08-26 09:34:46,281 DEBUG [ActiveMQ Journal Checkpoint Worker] o.a.a.s.k.MessageDatabase Checkpoint started.
2013-08-26 09:34:46,403 DEBUG [ActiveMQ Journal Checkpoint Worker] o.a.a.s.k.MessageDatabase Checkpoint done.
You have DEBUG logging level configured. You should change that to INFO etc so Camel / ActiveMQ will not log so much.
Check your logging configuration to adjust this.