Stability | Experimental |
---|---|
Maintainer | saihemanth@gmail.com |
Safe Haskell | None |
Provides API to pull from and push to ServiceBus queue Please refer to Service Bus Rest API for Service bus API
Following piece of code illustrates the use of API
module Main where import Web.WindowsAzure.ServiceBus.SBTypes import Web.WindowsAzure.ServiceBus.Queue import qualified Data.ByteString.Char8 as C main = do sbContext <- sbContext (simpleSBInfo sb-namespace insert-your-issuer-key) enQueueBS sbContext queue-name (C.pack hello Haskell world) res <- deQueue sbContext kqueue 30 print res
- enQueueBS :: String -> ByteString -> SBContext -> IO ()
- enQueueLBS :: String -> ByteString -> SBContext -> IO ()
- enQueueBodySrc :: String -> Int64 -> Source IO ByteString -> SBContext -> IO ()
- deQueue :: String -> Int -> SBContext -> IO ByteString
Pushing data to Queue
enQueueBS :: String -> ByteString -> SBContext -> IO ()Source
publish a message containing ByteString
to queue.
The following publishes a strict bytestring bs to queue q
enQueueBS q bs ctx
enQueueLBS :: String -> ByteString -> SBContext -> IO ()Source
publish a message containing ByteString
to queue
The following publishes a lazy bytestring ,lbs, to queue q,
enQueueLBS q lbs ctx
enQueueBodySrc :: String -> Int64 -> Source IO ByteString -> SBContext -> IO ()Source
publish from a Source
(refer to requestBodySource
)
Reading data from Queue
deQueue :: String -> Int -> SBContext -> IO ByteStringSource
Reads and deletes the message from a queue.
In order to destructively read the latest message from the queue (with a time out of n seconds),
deQueue queueName n context
Note that the timeout can be at the most 55 seconds. This silently ignores the timeouts greater than 55