Skip to content

Getting started with MIX

MIX stands for Mediated Information eXchange and defined in MIX-CORE (XEP-0369), MIX-PRESENCE (XEP-0403) and MIX-PAM (XEP-0405). More concretely, ejabberd supports MIX 0.14.1.

It is a work in progress extension for the XMPP protocol to build a group messaging protocol that does not rely on the presence mechanism. It is designed to overcome the limitation of Multi-User Chat (XEP-0045) , in a context where most clients are mobile clients.

To do so, MIX is built on top of PubSub (XEP-0060) and use different nodes per channel to separate event types. There is five nodes to support five different types of event for each MIX channel:

  • Messages
  • Presence
  • Participant list changes
  • Subject update
  • Conversion configuration changes

This is a work in progress, but this is a very important task and we are happy to provide the very first server implementation of the Mix protocol to get up to speed on that specification.

Here is a short walk through what can already be done.

Also note that the specification can (and will) change significantly before it becomes stable. These examples are based on XEP-0369 v0.1.


Configuration is simple:

  • Install a recent ejabberd version (19.02 or newer)

  • You need to add mod_mix and mod_mix_pam in ejabberd configuration, modules section:

      mod_mix: {}
      mod_mix_pam: {}
  • Make sure you have PubSub enabled. Default configuration is fine:

        access_createnode: pubsub_createnode
          - "flat"
          - "pep"
  • The examples assume you have this virtual host:

      - shakespeare.example


There is no client supporting MIX yet so here is how it works directly at XMPP stream level.

Here are real-life examples from playing with our MIX implementation:

Creating a MIX Channel

First of all, create a new MIX channel following 7.3.2 Creating a Channel:

<iq id='lx09df27'
  <create channel='coven' xmlns='urn:xmpp:mix:core:0'/>

Joining a MIX Channel

Now tell your server that you want your account to join that MIX channel, using MIX-PAM: 2.7 Joining a Channel:

<iq type='set'
  <client-join xmlns='urn:xmpp:mix:pam:0'
    <join xmlns='urn:xmpp:mix:core:0'>
      <nick>third witch</nick>
      <subscribe node='urn:xmpp:mix:nodes:messages'></subscribe>
      <subscribe node='urn:xmpp:mix:nodes:presence'></subscribe>
      <subscribe node='urn:xmpp:mix:nodes:participants'></subscribe>
      <subscribe node='urn:xmpp:mix:nodes:subject'></subscribe>
      <subscribe node='urn:xmpp:mix:nodes:config'></subscribe>

You receive IQ that confirms success:

<iq type="result"
  <client-join xmlns='urn:xmpp:mix:pam:0'>
    <join xmlns="urn:xmpp:mix:core:0"
      <nick>third witch</nick>
      <subscribe node="urn:xmpp:mix:nodes:messages"></subscribe>
      <subscribe node="urn:xmpp:mix:nodes:presence"></subscribe>
      <subscribe node="urn:xmpp:mix:nodes:participants"></subscribe>
      <subscribe node="urn:xmpp:mix:nodes:subject"></subscribe>
      <subscribe node="urn:xmpp:mix:nodes:config"></subscribe>

Subscribers on the participants node for that channel will also receive the new list of participants (so, including ourselves in that case):

<message from="coven@mix.shakespeare.example"
 <event xmlns="">
  <items node="urn:xmpp:mix:nodes:participants">
   <item id="3d1766e2bd1b02167104f350f84b0668f850ef92">
    <participant xmlns="urn:xmpp:mix:core:0" jid="hag66@shakespeare.example"></participant>

Setting a nick

You may want to set a nick for this channel (see 7.1.4 Setting a Nick):

<iq type='set'
  <setnick xmlns='urn:xmpp:mix:core:0'>

Note: Support for MIX nickname registration is not implemented in ejabberd.

Sending and receiving messages

You can now start chatting with your peers, by publishing on the message node (see 7.1.6 Sending a Message):

<message to='coven@mix.shakespeare.example'
  <body>Harpier cries: 'tis time, 'tis time.</body>

The message is received by all subscribers on the message node on that MIX channel:

  <mix xmlns='urn:xmpp:mix:core:0'>
  <body>Harpier cries: &apos;tis time, &apos;tis time.</body>

Querying participants list

A participant can always get list of participants with a PubSub query on node items for the channel (see 6.6 Determining the Participants in a Channel):

<iq type='get'
  <pubsub xmlns=''>
    <items node='urn:xmpp:mix:nodes:participants'></items>

The channel will reply with list of participants:

<iq to='hag66@shakespeare.example/tka1'
  <pubsub xmlns=''>
    <items node='urn:xmpp:mix:nodes:participants'>
      <item id='19be8c262ed618e078b7'>
        <participant nick='thirdwitch'
      <item id='6be2b26cbf4d7108f1fb'>
        <participant jid='hag77@shakespeare.example'


At the moment it is unclear from XEP-0369 example how you match a message you receive to a participant. We are going to improve our implementation in the following way:

  1. Add a participant id on the item tag when broadcasting new participant.
  2. Add the participant id on the published items.
  3. Add the participant id in participants list on the publisher

Another issue is that the current specification and implementation will have trouble scaling and offer plenty of opportunities for "Denial of Service" attacks. This is something that will change in the future as the specification matures. However, currently, do not deploy or rely on this implementation for large-scale production services. The work is still an experiment to progress on the specifications by offering client developers to give real life feedback on a reference implementation of the current specification.


We are only at the beginning of MIX. However, we are excited to have reached a point where it is already usable in some cases.

It is still missing on administrative tasks, right management, user invitations, relationship with MAM archiving and probably a lot more. And we need consolidations on participants message attribution. However, we want to iterate fast with client developers to prototype implementation changes and have meaningful and real life feedback to improve XEP-0359.

Send us your feedback !