Skip to content

Instantly share code, notes, and snippets.

@mavnn
Created November 1, 2012 12:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mavnn/3993268 to your computer and use it in GitHub Desktop.
Save mavnn/3993268 to your computer and use it in GitHub Desktop.
EasyNetQ on F#
module Program
open EasyNetQ
type MyMessage = { Message : string }
let bus = RabbitHutch.CreateBus("host=192.168.56.1")
bus.Subscribe<MyMessage>("FSharpTest", fun mesg -> printfn "%A" mesg.Message)
bus.Publish({ Message = "Hello world"})
// Output is:
"""
DEBUG: Trying to connect
INFO: Connected to RabbitMQ. Broker: '192.168.56.1', VHost: '/'
DEBUG: Published Program+MyMessage:EasyNetQFSharp, CorrelationId 95f352f1-e689-481f-bc89-52b33ffae7ba
DEBUG: Subscriber Recieved Program+MyMessage:EasyNetQFSharp, CorrelationId 95f352f1-e689-481f-bc89-52b33ffae7ba
"Hello world"
""" |> ignore
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment