jms-topic

JMS durable subscriber in a cluster with multiple instances

末鹿安然 提交于 2019-12-11 07:34:02
问题 I am going to be using Payara BTW.... Suppose I have: A JMS Topic An MDB configured as a durable topic subscriber Multiple instances of the MDB are deployed across the cluster and they are all using the same client ID value to make the durable subscription. If this is the scenario, and given the way client ID values and durable subscriptions work, is it correct to say that only 1 of the MDB instances across the cluster will succeed in connecting and the others will fail? Thanks! Suppose you

logstash Input painfully slow while fetching messages from activemq topic

我的梦境 提交于 2019-12-10 22:59:51
问题 I have configured JMS input in logstash to subscribe to JMS topic messages and push messages to elastic search. input { jms { id => "my_first_jms" yaml_file => "D:\softwares\logstash-6.4.0\config\jms-amq.yml" yaml_section => "dev" use_jms_timestamp => true pub_sub => true destination => "mytopic" # threads => 50 } } filter { json{ source => "message" } } output { stdout { codec => json } elasticsearch { hosts => ['http://localhost:9401'] index => "jmsindex" } } System specs: RAM: 16 GB Type:

Preventing thread from duplicate processing in java

本小妞迷上赌 提交于 2019-12-10 08:48:34
问题 Problem statement I have a JMS listener running as a thread listening to a topic. As soon a message comes in, I spawn a new Thread to process the in-bounded message. So for each incoming message I spawn a new Thread . I have a scenario where duplicate message is also being processed when it is injected immediately in a sequential order. I need to prevent this from being processed. I tried using a ConcurrentHashMap to hold the process times where I add in the entry as soon as Thread is spawn

If my producer producing, then why the consumer couldn't consume? it stuck @ poll()

大憨熊 提交于 2019-12-08 12:30:43
问题 Im publishing to the remote kafka server and try to consume messages from that remote server. (Kafka v 0.90.1) Publishing works fine but nor the consuming. Publisher package org.test; import java.io.IOException; import java.util.Properties; import org.apache.kafka.clients.producer.KafkaProducer; import org.apache.kafka.clients.producer.ProducerRecord; public class Producer { private void generateMessgaes() throws IOException { String topic = "MY_TOPIC"; Properties props = new Properties();

Preventing thread from duplicate processing in java

北城余情 提交于 2019-12-05 17:44:48
Problem statement I have a JMS listener running as a thread listening to a topic. As soon a message comes in, I spawn a new Thread to process the in-bounded message. So for each incoming message I spawn a new Thread . I have a scenario where duplicate message is also being processed when it is injected immediately in a sequential order. I need to prevent this from being processed. I tried using a ConcurrentHashMap to hold the process times where I add in the entry as soon as Thread is spawn and remove it from the map as soon Thread completes its execution. But it did not help when I tried with

Counting Number of messages stored in a kafka topic

不想你离开。 提交于 2019-12-03 05:41:56
问题 I'm using 0.9.0.0 version of Kafka and I want to count the number of messages in a topic without using the admin script kafka-console-consumer.sh. I have tried all the commands in the answer Java, How to get number of messages in a topic in apache kafka but none are yielding the result. Can anyone help me out here? 回答1: You could try to execute the command below: bin/kafka-run-class.sh kafka.tools.GetOffsetShell --broker-list localhost:9092,localhost:9093,localhost:9094 --topic test-topic -

How to share messages, published on Topic, between multiple VMs, in Spring Jms Tibjms

扶醉桌前 提交于 2019-11-30 23:49:59
My application is consuming messages published to a Topic. I have 3 servers where my application code is running. With current implementation, the messages is distributed to all running VMs i.e. copy of message is received by every consumer. My requirement is that every consumer should receive distinct message i.e. no two consumer should get same message. Below are the libraries I am using: spring jms 4.2.7 Java jms 2.0 tibco jms 8.0 wildfly-swarm as server Currently I have following configuration : TibjmsConnectionFactory factory = new TibjmsConnectionFactory("server-url"); factory