In short, I want ejabberd server to send some messages to a group of user clients.
the group of users may change. For example, the server send message to group 1, and then send different message to group 2.
In other words, how to make ejabberd server send messages to client? I know how to send message from client to client.
Sending a single message to multiple recipient is defined in XEP-0033: Extended Stanza Addressing: http://xmpp.org/extensions/xep-0033.html
This XEP is supported by ejabberd.