Message delivery when user is offline
I have a plugin for OpenFire that creates and delivers a message to a user using
XMPPServer.getInstance().getMessageRouter().route(message)
What I would like to know is what happens to that message if the user is not online.
My goal is to only have the message delivered if the user is online, and fail or be routed to the bit bucket otherwise.
Asked by: Lucas199 | Posted: 21-01-2022
Answer 1
It's all down to Openfire config. In the Openfire admin console, go to Server -> Server Settings -> Offline Messages. There are options for store, bounce and drop.
- Store: deliver the message when the user comes back online.
- Drop: Just discard the message.
- Bounce: Discard and notify the sender with a return message.
Answer 2
Another approach, if you just want these messages to not go offline without affecting the delivery of other messages, is to use type='headline'. Headlines are not terribly well-specified, but RFC 3921bis Section 5.2.2 says:
headline -- The message provides an alert, a notification, or other information to which no reply is expected (e.g., news headlines, sports updates, near-real-time market data, and syndicated content). Because no reply to the message is expected, typically a receiving client will present a message of type "headline" in an interface that appropriately differentiates the message from standalone messages, chat messages, or groupchat messages (e.g., by not providing the recipient with the ability to reply). The receiving server SHOULD deliver the message to all of the recipient's available resources.
Most servers of today will just silently drop headlines to offline users, and deliver to the highest priority resource if the user is online.
Answered by: Edgar382 | Posted: 22-02-2022Similar questions
Message lost on a long delivery path using java nio
In my project, a sequence of messages are forwarded from A to B to ... to K. The delivery path is 11 nodes. The socket is java nio. The problem is that some messages are lost and not received at the last node. What is the reason of this exception? Thanks.
I am using TCP and only use java nio library. The exception: for example, at the starting node, there is 2999 messages published. At the ending node, there ...
java - How do I delay delivery of a JMS message using HornetQ?
Basically, I want the HornetQ equivalent of:
message.setLongProperty("JMS_JBOSS_SCHEDULED_DELIVERY", System.currentTimeMillis() + processingDelayInMS);
java - Right design in akka. - Message delivery
I have gone through some posts on how and why akka does not guarantee message delivery. The documentation, this discussion and the other discussions on group do explain it well.
I am pretty new to akka and wish t...
java - Delivery Message SMSLib
I am using SMSLib v4 for communicating with a GSM gateway in IP mode.
I send and receive messages successfully but the problem is with delivery message.
After testing with Diaffan SMS Server I figured out when sending with receiver number in international format (e.g +98........) the delivery message came in Diafaan.
I set options such that PDUs in both of them become same. But steel didn't receive delivery in my app.
...
java - Aws IoT Message Delivery
I am looking into Amazon IoT as a transport mechanism for mobile devices periodically measuring data (usually every N minutes, with N being anywhere between 2 and 32 minutes). With MQTT, I can utilize Amazon's broker to publish finished measurement results to subscribers with QoS=1. Let's also assume that my sole subscriber is just another device listening on wildcard topic (eg. abc/#) and storing published messages into a...
An event delivery library in Java?
I'm looking for a library that will allow me to deliver simple text events from the server to the clients via sockets. Something simple and lightweight. I can write it myself, but decided to check if such thing exists first. The idea is that there's an application that generates events (such as order rejected or an internal error occurred) and acts as a server. Those events must be delivered to all connected clients in re...
sms - java for kannel delivery report
I have successfully written a class for sending SMS over kannel in Java. But I have big problems to write a delivery report class. Any idea how to write it?
Message lost on a long delivery path using java nio
In my project, a sequence of messages are forwarded from A to B to ... to K. The delivery path is 11 nodes. The socket is java nio. The problem is that some messages are lost and not received at the last node. What is the reason of this exception? Thanks.
I am using TCP and only use java nio library. The exception: for example, at the starting node, there is 2999 messages published. At the ending node, there ...
java - How do I delay delivery of a JMS message using HornetQ?
Basically, I want the HornetQ equivalent of:
message.setLongProperty("JMS_JBOSS_SCHEDULED_DELIVERY", System.currentTimeMillis() + processingDelayInMS);
Java: JMS message delivery order for different sessions
Recently a colleague of mine said this:
When using different sessions for producing and consuming messages, there's no guarantee that messages are delivered in the same order in which they are produced.
Now I know that JMS does not guarantee message delivery order in general, but this 'multiple sessions' angle is new to me. Is there any truth to this?
smtp - How to make program wait for a delivery status of the mail using Java mail API
I am implementing a program which has to send mails to users, one after the other. But the problem is it has to wait until it gets the the delivery status for the previously sent mail. So how can i achieve this?
java - Slowing Down Rabbit MQ Delivery Rate
I am using Rabbit MQ for my application. Sometimes I need to stop my consumers due to maintenance. So, there will be thousands of messages waiting on the queue. After I restart my consumers, the message delivery rate is high (500-600 messages per second). At that rate, one of my consumers cannot handle the messages and break down the server.
I will change consumer code in the future, but now I need an quick soluto...
java - Right design in akka. - Message delivery
I have gone through some posts on how and why akka does not guarantee message delivery. The documentation, this discussion and the other discussions on group do explain it well.
I am pretty new to akka and wish t...
java - Apache James: Get notify once delivery or bounce
I have a project which require the updates from mail server, I intend to use Apache James.
The updates required are:
When the mail sent: I need the time when it is sent
When the mail bounced: I need the bounced time, reason and is it soft bounce or hard bounce.
I know that James have hook mechanism and Mailet (looks like this only for process before send). I try to google aroun...
java - How to receive Message Delivery Receipts on Openfire?
How can I receive Message Delivery Receipts on Openfire Server?
I would like to receive an acknowledgement at the following states:
When the message is received by the Openfire server
When the receiver client receives the message
When the receiver has read the message.
In a nutshell, I would like to implement features like PENDING, SINGLE TICK, DOUBLE TICK, BLUE DOUBLE...
Still can't find your answer? Check out these amazing Java communities for help...
Java Reddit Community | Java Help Reddit Community | Dev.to Java Community | Java Discord | Java Programmers (Facebook) | Java developers (Facebook)