Here you can find Haskell code examples from RabbitMQ tutorials.
To run this code you need Network.AMQP.
- Install
stack. - Run the scripts via
stack FILE ARGSinstead ofrunhaskell FILE ARGS. (This installsghc, plusamqpand other required packages for you.)
Code examples are executed via runhaskell.
Tutorial one:
runhaskell send.hs
runhaskell receive.hsTutorial two:
runhaskell newTask.hs hello world
runhaskell worker.hsTutorial three: Publish/Subscribe
runhaskell receiveLogs.hs
runhaskell emitLog.hs hello worldTutorial four: Routing
runhaskell receiveLogsDirect.hs info warn
runhaskell emitLogDirect.hs warn "a warning"Tutorial five: Topics
runhaskell receiveLogsTopic.hs info warn
runhaskell emitLogTopic.hs warn "a warning"Tutorial six: RPC
runhaskell rpcServer.hs
runhaskell rpcClient.hsTo learn more, see Network.AMQP.