activemq | activemqspringjms - | Application Framework library
kandi X-RAY | activemq Summary
kandi X-RAY | activemq Summary
activemq
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Send a message
- Gets the message
- Get the current semaphore
- On JMS message
activemq Key Features
activemq Examples and Code Snippets
Community Discussions
Trending Discussions on activemq
QUESTION
I am new in Spring Boot, I am trying to connect to SQL Server in Windows Authentication mode and here is my database configuration:
...ANSWER
Answered 2022-Apr-17 at 23:55I found the solution and it was only to use
integratedSecurity = false;
instead of
integratedSecurity = true;
so in this case connection string will be:
database.name= DatabaseName spring.datasource.url=jdbc:sqlserver://1.2.3.4:11111;DatabaseName=${database.name};integratedSecurity = false;.
Why to use integratedSecurity = false? The reason is here:
"Integrated Security When false, User ID and Password are specified in the connection. When true, the current Windows account credentials are used for authentication."
QUESTION
I'm currently struggling with exposing the REST api in my project using Apache Camel. When I run the project it seems to be fine in the console, but it just doesn't work:
curl: (7) Failed to connect to 127.0.0.1 port 8080: Connection refused
Here's the pom.xml file:
...ANSWER
Answered 2022-Mar-25 at 16:33The component camel-servlet
is not meant to be used in standalone mode as you are trying to do. It is meant to be used when you deploy your Camel application on a Servlet container or an Application Server.
In standalone mode, if you want to expose a rest endpoint, you should rather use a component like camel-undertow
, camel-jetty
, camel-netty-http
or camel-platform-http
(you can find the full list here).
Assuming that you want to use undertow
, you will have to follow the next steps
In your pom file you need to replace camel-rest
with camel-undertow
, as next:
QUESTION
I have the below route and bean to get the message from the property file. In some message I have to replace the arguments in the message. Therefore I have looked for a solution without writing 2 methods in the bean one with arguments (getMessageWithArgs
) and the second without arguments (getMessage
).
Is it doable to get rid of getMessageWithArgs
in the bean by using DSL in the route or to make the arguments in the getMessage
optional so I have at the end one method in the bean?
Route
...ANSWER
Answered 2022-Mar-25 at 17:18I think Arbitrary Number of Arguments may work for you.
http://java.sun.com/docs/books/tutorial/java/javaOO/arguments.html#varargs
So the Bean now will be only one like:
QUESTION
I am trying to setup simple cluster of 2 ActiveMQ Artemis brokers within Docker Swarm environment.
Stack configuration
...ANSWER
Answered 2022-Mar-18 at 13:53The connector
named "netty_connector" shouldn't use 0.0.0.0
. This is the address that will be sent to other nodes in the cluster to tell them how to connect back to the node who sent it. The address 0.0.0.0
will be meaningless in that context. It needs to be the actual IP address or hostname where the broker is listening for network connections.
QUESTION
My ActiveMQ messaging instance (ActiveMQ 5.16.2 on Amazon MQ) uses STOMP. I cannot use the JMS QueueBrowser, and there is no way to "unack" a message. As soon as there is a consumer that pulled that message from the queue i.e. marked as "unconsumed" as stated in the docs here.
Assuming the broker cannot be changed, I was looking at the REST API mapping of JMS here, but I do not see any endpoint that mimic the ActiveMQ admin pages (JSP), that is capable to browse the queue, consumers and message content without actively "pulling" those messages from the queue.
So, how to implement that JMS logic we can see in the ActiveMQ admin pages programmatically (e.g. via REST apis)?
Looking at the docs of REST API, assumed having the logon, this approach works
...ANSWER
Answered 2022-Mar-07 at 17:15The REST/JMS mapping doesn't offer any message browsing functionality.
However, it's worth noting that the REST/JMS mapping is independent of the management functionality exposed by Jolokia. Jolokia is an HTTP-JMX bridge so anything exposed via JMX can be accessed via HTTP (e.g. using curl
). The DestinationViewMBean
has various "browse" methods you can use, e.g.:
QUESTION
I'm consuming messages from an ActiveMQ Artemis topic using JMS. My consumers are connecting directly to the FQQN of their consumer queues. Like this:
...ANSWER
Answered 2022-Mar-04 at 16:18It's not possible to configure the broker to auto-create a dead-letter queue whose name contains the name of the queue where the message was originally sent. As noted in the documentation, the dead-letter queue is named according to the address where the message was originally sent along with any configured prefix and/or suffix.
However, the message itself will have a property named _AMQ_ORIG_QUEUE
which will contain the name of the queue where the message was originally routed. This means you can use a consumer with a message selector (e.g. _AMQ_ORIG_QUEUE = 'ConsumerA'
) so that the consumer will only receive messages which were originally routed to a particular queue. This is functionally equivalent to having a dead-letter queue per-queue.
For what it's worth, what you're calling the "consumer name" isn't the name of the consumer at all, at least not from the broker's point of view. It's just the name of the queue.
Ultimately it's just not possible to configure a dead-letter queue per-queue. It's only possible to configure a dead-letter queue per address. This is true whether the resources are create manually (e.g. via broker.xml
) or automatically.
QUESTION
How can I provide a custom broker.xml
to my instance of ActiveMQ Artemis? The standard implementation generates the config data in the broker instance's etc
directory but I wish to mount my own config files.
ANSWER
Answered 2022-Feb-17 at 15:39If you're starting the broker with the artemis run
command then you can pass the location of a custom bootstrap.xml
, e.g.:
QUESTION
I am trying to understand how ActiveMQ Artemis manages the journal files (under data/journal
) and when it creates new ones. I read the documentation, but it wasn't clear how the files are create. I have a broker.xml
has simple settings (won't be able to share unfortunately). Here are a few:
- journal min threads - 2
- journal pool size - 50
- file size is defaulted to 10MB.
ActiveMQ Artemis starts, and I see 2 files are already created under /data/journal
. I am now running a request that posts a lot of messages in a very short time. These messages are being actively consumed. I am publishing a lot of messages but they are not accumulating as fast because the consumer is consuming them. However, this doesn't cause the files to grow to recreate the space issue.
As the message volume is going up I don't see the number of files going up. It goes up and stays at 12 files for a long time. I can understand the message # is not sufficient trigger additional files if only the latest journal file is being written to. However, I see all the 11 files have updated timestamps making me think they are being rotated.
My paging directory is empty.
I am trying to understand why the journal is not growing despite the message volume.
...ANSWER
Answered 2022-Feb-03 at 14:42From what I can tell, message consumption has reached a break-even point with message production so that messages are not accumulating on the broker therefore the journal is not actually growing in size. The journal files are simply being re-used as messages are being added & acknowledged.
QUESTION
I have a Node.js app in which I use stomp-client to connect and subscribe to an ActiveMQ topic without websockets. My code is the same as this example: https://www.npmjs.com/package/stomp-client#super-basic-example.
Now, I want to do the same thing, but with a Vue.js application. So, I want to subscribe to an ActiveMQ topic in the browser (i.e., in JavaScript, not in Node.js). My ActiveMQ is not configured to support websockets. Is it possible to do this in a browser without websockets?
...ANSWER
Answered 2022-Feb-02 at 19:34No, this is a security constraint that is part of web standards.
QUESTION
I have a use case where I need to convert a message from one type to another (i.e. TextMessage
-> ObjectMessage
).
I found that when diverting between queues there is an option to transform the message. I have implemented the Transformer
interface as instructed in the documentation.
ANSWER
Answered 2022-Feb-02 at 17:23It should technically be possible to convert a javax.jms.TextMessage
to a javax.jms.ObjectMessage
, but it may be cumbersome. Here are some important things to note:
javax.jms.TextMessage
,javax.jms.ObjectMessage
, andorg.apache.activemq.artemis.api.core.Message
are all just interfaces. Thejavax
version is what you use on the client andMessage
is what is used on the broker. The data for each type of message is stored differently in the underlying message implementation.- The class for the Java object that you wish to put into the
ObjectMessage
will need to be on the broker's classpath. This isn't required under normal circumstances as the broker itself will never serialize or deserialize the object. - You should really try to avoid
ObjectMessage
whenever possible.ObjectMessage
objects depend on Java serialization to marshal and unmarshal their object payload. This process is generally considered unsafe (and slow!), because a malicious payload can exploit the host system. Lots of CVEs have been created for this. For this reason, most JMS providers force users to explicitly whitelist packages that can be exchanged usingObjectMessage
messages. For example, here's the related documentation for ActiveMQ Artemis. There are a number of other issues with using JMSObjectMessage
not related to security that you should read about.
Granted you understand all that you should be able to convert the message using code something like this:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
Install activemq
You can use activemq like any standard Java library. Please include the the jar files in your classpath. You can also use any IDE and you can run and debug the activemq component as you would do with any other Java program. Best practice is to use a build tool that supports dependency management such as Maven or Gradle. For Maven installation, please refer maven.apache.org. For Gradle installation, please refer gradle.org .
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page