How can i send a message to disconnected customers with spring kafka? - spring-boot

I can not send messages to disconnected clients.
I use spring boot with apach kafka as a message broker.

If you assign a consumer group id to a user's inbox, then the consumer protocol will read from the last unread message automatically until you commit the consumed offset back to Kafka
Kafka persists messages itself and consumers are not required to be online to receive events sent immediately from producers

Related

Kafka refresh event is not broadcasted to all subscriber on single topic

I am getting an unexpected scenario where all subscribers(Spring boot application) of a single Kafka topic are not getting Spring Cloud Config configuration change refresh notifications. Only one subscriber is getting refresh notification who has Kafka partition. Other subscriber isnot assigned with Kafka partitions and not getting refresh event.
That is how Kafka works, and so should be expected; only one active consumer in a consumer group can read any single message from a partition.
You'll need external libraries that distribute that consumed event to other channels.

Does Spring Kafka producer guarantee delivery by default?

I wonder whether spring kafka Producer within spring boot guarantee delivery or not.
Does anybody know what happens if some random listener fails to receive message? Would spring kafka retry to send the message?
There are some concepts here:
Producer will produce events and send them to kafka server. You must be aware on the producer side for retries and things like that if Kafka will have downtime or other error scenarios that are specific to your context.
Consumers will have assign partitions by Kafka, each partition will deliver events and each event will have an offset. Consumers will poll for data from kafka (they will request for data, kafka will not push data to consumers, but consumers will go to kafka and require data). Every event that is delivered with success by Kafka to the consumers will produce and Acknowledgment and Kafka will commit the offset of the event. So the next event, with a higher offeset will be delivered to the consumer. If a consumer goes down, partitions will be reasigned to other consumers, so you won't lose your data. If you have only one consumer, the data will be stored in Kafka and when the consumer will be back, it will go and request data from the latest/earliest offset.

Persistence Message Queue behavior with no subscribers (ActiveMQ)

We develop NMS product that has been deployed by couple of telecom operators. Our application (uses ActiveMQ) will publish Fault notifications to the Fault Queue, the messages are set to be persistent. These messages are consumed by third party JMS clients. Not all the customers will have a notification client to consume the events(some of the deployments will not have any subscriptions). The question is, does ActiveMQ persist the messages if the queue never had a subscriber connected to the Queue?.
The Broker will persist messages to a Queue regardless of the presence of consumers when the message is tagged as persistent. That is the general contract of the Queue model.

Send Active MQ messages throught Camel that were sent to a AMQ topic while Camel was down

I have configured an Active MQ server that puts messages to a determined topic, in that moment a configured Camel server take this message and send it by a route to another server, the issue happens when Camel server is down and the Active MQ still continues putting messages in the topic and when Camel starts these past messages are not read by Camel, is there any way to configure Camel to start and read past messages from this Active MQ Server?
Its ActiveMQ / JMS questions. Take a look at durable topics
http://activemq.apache.org/how-do-durable-queues-and-topics-work.html

Spring JMS consumer pull

I need to implemt a pulling consumer.
Most of the examples I see are the producer pushing a message to the consumer; Assuming consumer is always up.
I want the producer to push messages to a queue and the consumer to consume those messages on its own schedule.
My consumer has a off hours calender and cannot process requests during off hours.
How would I configure that in spring.
TIA
Raghu
Use message driven POJOs and JMS.
The onMessage is a server push, The message is processed as soon as it is delivered to the client. I want the client to decide when it wants to pull the message and process it.

Resources