Twiliofaces sms resource adapter is a JMS resource adapter, witch enable your application to receive twilio sms using a message driven bean.

Simple instructions to use:

  • add to your jboss-as-7.x/standalone/deployments

  • create a new web app, with twiliofaces, org.jboss.netty…​ dependencies:

    <?xml version="1.0" encoding="UTF-8"?>
    			<module name="deployment.twiliofaces-sms-ra-xxx.rar" />
  • in the WEB-INF/web.xml add http tunnel servlet:


  • create a mdb wich use twiliofaces-sms-ra adapter:

    import java.util.Enumeration;

    import javax.ejb.MessageDriven;
    import javax.jms.JMSException;
    import javax.jms.MapMessage;
    import javax.jms.Message;
    import javax.jms.MessageListener;

    import org.jboss.ejb3.annotation.ResourceAdapter;
    public class SmsReceiverMDB implements MessageListener

    public void onMessage(Message smsMessage)
      System.out.println("we received a new twilio sms message!");
      if (smsMessage instanceof MapMessage)
         MapMessage mess = (MapMessage) smsMessage;
            Enumeration<?> e = mess.getMapNames();
            while (e.hasMoreElements())
               String key = (String) e.nextElement();
               String value = mess.getString(key);
               System.out.println(key + ": " + value);
         catch (JMSException e1)
            // TODO Auto-generated catch block


comments powered by Disqus


Do you want collaborate with us?
Do you like this project?
Please send me an email!

Github code

Fork the twiliofaces repository on GitHub
and clone it to your local PC.

Get Started

Copy the Twiliofaces JAR file into your /WEB-INF/lib directory, or include all required Maven dependencies in your pom.xml!