title: How to send a broadcast message with SmackAPI?
body: <p>We're developing special devices that uses XMPP to talk to each other. A new API i am developing now, should talk to these devices too. The problem i am facing - all these devices are building little groups - for each customer we have... so we will have a chat-room for each group of devices, or, for each of our customer with his bunch of devices ;)</p>
  
  <p>But now.. the api should be able to talk to every device that is connected. I don't need a real broadcast-mechanism - in the end, i will send a message only to one specific device..</p>
  
  <p>But i don't want to login to each chat-room either - running a product with over 40k customers and much more devices, will end in a funny api, that is opening over 40k chat-rooms at startup... even if don't tried this yet, i can't imagine that an app like this will run well... even though we can have millions of customers in a few years.. i don't like solutions that will grow linear with the amount of customers, if you know what i mean :/</p>
  
  <p>Now, basically i'm thinking of a solution, where i just can use the basic XMPPConnection to do my stuff.</p>
  
  <pre><code>MyCustomMessage msg = new MyCustomMessage();
  msg.setTo("*"); // don't know what to address, i want to send it to "all"
  msg.setFrom("ThatAPI"); // just a string telling that is sent from my java api ;)
  
  msg.setEvent(event); // stuff that is coming through the parameters of the method where this code is inside
  msg.setCustomStanza(data); // same here
  
  connection.sendPacket(msg); // my try to send it to all till now..
  </code></pre>
  
  <p>Somewhere in the Ignite Realtime Forums i have read of one guy who "solved" it, but everything he says is "it's working now, i push my message through the sendPacket of Connection"... ok nice, my attempt of this seems not to work :(</p>
  
  <p>Any better ideas/real implementations how this will work fine?</p>
  
  <p>Basically i start to think that XMPP will not be the best technology to achieve something like this at all - i wish i could have a real/basic socket-implementation where something like this would be piece of cake.. But i can't choose - the third-party-system has implemented XMPP already... not enough time to change all of this... Just if you're wondering why we try this on XMPP..</p>