Lemonld...eBroker(3)

πŸ’– Lemonldap::NG::Common::MessageBroker β€” the manual page, but make it slay πŸ’–

okay bestie, gather round, because this is the Lemonld...eBroker(3) page from the User Contributed Perl Documentation and we're gonna get into it. It's the doc for the MessageBroker classes. No cap. πŸ¦‹


✨ NAME ✨

Lemonldap::NG::Common::MessageBroker β€” literally just the doc for MessageBroker classes. That's the whole name. Iconic, minimal, ate. πŸ’…


🌸 DESCRIPTION 🌸

So starting from 2.20.0, Lemonldap::NG dispatches its events to other nodes using messages sent by a Lemonldap::NG::Common::MessageBroker sub class. Yes, sub class, we're being fancy. ✨

By default, only 2 kind of messages are dispatched:

  • configuration updates β€” every single time a configuration is saved.
heads up: the default broker also adds such messages regularly following the chectTime value (because it's not a real evant pub/sub system β€” yes, we said evant, that's what the page says, moving on πŸ’€). This keep previous behavior.
  • session logouts β€” whenever a session is terminated before it expires (either because the user logged out or by action of an administrator).

The default broker just pushes this information on the local node. Other nodes will discover the end of session after local cache expiration β€” that's max 10 minutes, so like, be patient. 😭

By default, LLNG uses only one channel, and it's defined in the eventQueueName configuration parameter. One channel. One vibe. πŸŽ€

During initialization, LLNG always creates 2 distinct objects:

  • a reader which calls subscribe() for each channel and then checks for messages every 5 seconds πŸ”₯
  • a writer which sends messages on channels ✍️

The Lemonldap::NG::Hanlder::Main::MsgActions class contains actions to be launched when a message enters the main events channel. Yes, Hanlder. We copy it exactly. We don't fix it. We respect it. 🫢


πŸ’œ METHODS πŸ’œ

Except applyConf, all this methods must exist in a Message Broker. All of them, bestie. No skipping. ⭐

🧚 new

Constructor. Arguments:

  • $class: class name
  • $conf: current LLNG configuration
  • $logger: a Lemonldap::NG::Common logger

🧚 publish

Method to insert an message. Arguments:

  • $self
  • $channel: the channel name
  • $msg: a hash reference containing the message

🧚 subscribe

Methode called during LLNG initialization for its message reader object. Arguments:

  • $self
  • $channel: the channel name

🧚 getNextMessage

Non blocking method that return a message in the given channel if one exists. Arguments:

  • $self
  • $channel: the channel name

🧚 waitForNextMessage

Blocking method that waits for a message in the given channel and return it. Arguments:

  • $self
  • $channel: the channel name
⚠️ bestie, notice the difference: getNextMessage is non blocking, waitForNextMessage is blocking. That's the whole plot twist. πŸ‘‘

🧚 applyConf

Optional method called after configuration save. It is used only with the default message broker to launch previous behavior: call all reload URLs. Lowkey a legacy moment, but she's still serving. πŸ’…


πŸŽ€ MESSAGE FORMAT πŸŽ€

A message is a HASH reference. A message in the main event channel must contain a key action. This key is used by Lemonldap::NG::Hanlder::Main::MsgActions to launch the corresponding method.

  • Configuration update
{
  action => 'newConf'
}
  • Session end
{
  action => 'unlog',
  id => '<configuration id to be removed from local cache>'
}

πŸ”₯ SEE ALSO πŸ”₯

Lemonldap::NG::Manager, Lemonldap::NG::Portal, Lemonldap::NG::Handler


πŸ‘‘ AUTHORS πŸ‘‘

LemonLDAP::NG team <http://lemonldap-ng.org/team>


πŸ™ˆ BUG REPORT πŸ™ˆ

Use OW2 system to report bug or ask for features: <https://gitlab.ow2.org/lemonldap-ng/lemonldap-ng/issues>


🌈 DOWNLOAD 🌈

Lemonldap::NG is available at <https://lemonldap-ng.org/download>


See COPYING file for details.

This library is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.


and that's the whole page, bestie 🫢 this was rendered with perl v5.42.3, dated 2026-09-24, and it's the Lemonld...eBroker(3) page β€” go forth and dispatch your messages, main character πŸ’–πŸ¦‹βœ¨

πŸ“¦ where this page comes from