简体   繁体   English

用户离线时的邮件传递

[英]Message delivery when user is offline

I have a plugin for OpenFire that creates and delivers a message to a user using 我有一个用于OpenFire的插件,它使用以下命令创建并向用户传递消息

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. 我的目标是仅在用户在线时传递消息,否则将失败或路由到位存储桶。

It's all down to Openfire config. 一切都取决于Openfire配置。 In the Openfire admin console, go to Server -> Server Settings -> Offline Messages. 在Openfire管理控制台中,转到服务器->服务器设置->离线消息。 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. 退回:丢弃并通过退回消息通知发件人。

Another approach, if you just want these messages to not go offline without affecting the delivery of other messages, is to use type='headline'. 如果只希望这些消息不脱机而不影响其他消息的传递,则另一种方法是使用type ='headline'。 Headlines are not terribly well-specified, but RFC 3921bis Section 5.2.2 says: 标题的定义不是很明确,但是RFC 3921bis第5.2.2节说:

headline -- The message provides an alert, a notification, or other information to which no reply is expected (eg, 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 (eg, 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. 如今,大多数服务器只会以静默方式为离线用户提供头条新闻,如果用户在线,则将其分配给优先级最高的资源。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM