package ActiveMQSample where data ActiveMQConnectionFactory = native org.apache.activemq.ActiveMQConnectionFactory where native createConnection :: Mutable s ActiveMQConnectionFactory -> STMutable s Connection throws JMSException native new :: () -> STMutable s ActiveMQConnectionFactory data Connection = native javax.jms.Connection where native close :: Mutable s Connection -> ST s () throws JMSException native createSession :: Mutable s Connection -> Bool -> Int -> STMutable s Session throws JMSException data Destination = pure native javax.jms.Destination data JMSException = pure native javax.jms.JMSException derive Exceptional JMSException data Message = pure native javax.jms.Message data MessageProducer = native javax.jms.MessageProducer where native send :: Mutable s MessageProducer -> Message -> ST s () throws JMSException data Queue = pure native javax.jms.Queue data Session = native javax.jms.Session where native autoAcknowledge javax.jms.Session.AUTO_ACKNOWLEDGE :: Int native createProducer :: Mutable s Session -> Destination -> STMutable s MessageProducer throws JMSException native createQueue :: Mutable s Session -> String -> ST s Queue throws JMSException native createTextMessage :: Mutable s Session -> String -> ST s TextMessage throws JMSException data TextMessage = pure native javax.jms.TextMessage main _ = do connFactory <- ActiveMQConnectionFactory.new () conn <- connFactory.createConnection sess <- conn.createSession false Session.autoAcknowledge dest <- sess.createQueue "SampleQueue" prod <- sess.createProducer dest msg <- sess.createTextMessage "Simples Assim" prod.send msg conn.close