amqp 0.2.7 → 0.2.8
raw patch · 3 files changed
+21/−13 lines, 3 filesPVP: major bump suggested
API removals or changes: PVP suggests a major version bump
API changes (from Hackage documentation)
+ Network.AMQP: msgCorrelationID :: Message -> Maybe String
- Network.AMQP: Message :: ByteString -> Maybe DeliveryMode -> Maybe Timestamp -> Maybe String -> Maybe String -> Maybe String -> Message
+ Network.AMQP: Message :: ByteString -> Maybe DeliveryMode -> Maybe Timestamp -> Maybe String -> Maybe String -> Maybe String -> Maybe String -> Message
Files
- LICENSE +1/−1
- Network/AMQP.hs +17/−11
- amqp.cabal +3/−1
LICENSE view
@@ -1,4 +1,4 @@-Copyright (c) 2010, Holger Reinhardt+Copyright (c) 2011, Holger Reinhardt All rights reserved.
Network/AMQP.hs view
@@ -338,7 +338,7 @@ Nothing (fmap deliveryModeToInt $ msgDeliveryMode msg) -- delivery_mode Nothing- Nothing+ (fmap ShortString $ msgCorrelationID msg) (fmap ShortString $ msgReplyTo msg) Nothing (fmap ShortString $ msgID msg)@@ -481,13 +481,14 @@ msgTimestamp :: Maybe Timestamp, -- ^ use in any way you like; this doesn't affect the way the message is handled msgID :: Maybe String, -- ^ use in any way you like; this doesn't affect the way the message is handled msgContentType :: Maybe String,- msgReplyTo :: Maybe String+ msgReplyTo :: Maybe String,+ msgCorrelationID :: Maybe String } deriving Show -- | a 'Msg' with defaults set; you should override at least 'msgBody' newMsg :: Message -newMsg = Message (BL.empty) Nothing Nothing Nothing Nothing Nothing+newMsg = Message (BL.empty) Nothing Nothing Nothing Nothing Nothing Nothing ------------- ASSEMBLY ------------------------- -- an assembly is a higher-level object consisting of several frames (like in amqp 0-10)@@ -698,7 +699,7 @@ -- connection is already closed, so call the handler directly Just _ | ifClosed == True -> handler - -- otherweise add it to the list+ -- otherwise add it to the list _ -> modifyMVar_ (connClosedHandlers conn) $ \old -> return $ handler:old @@ -770,9 +771,10 @@ let msgId = fromShortString message_id contentType = fromShortString content_type replyTo = fromShortString reply_to+ correlationID = fromShortString correlation_id in- Message msgBody (fmap intToDeliveryMode delivery_mode) timestamp msgId contentType replyTo+ Message msgBody (fmap intToDeliveryMode delivery_mode) timestamp msgId contentType replyTo correlationID where fromShortString (Just (ShortString s)) = Just s fromShortString _ = Nothing@@ -809,12 +811,16 @@ (ShortString routingKey)) properties msgBody) = withMVar (consumers chan) (\s -> do- let subscriber = fromJust $ M.lookup consumerTag s- let msg = msgFromContentHeaderProperties properties msgBody- let env = Envelope {envDeliveryTag = deliveryTag, envRedelivered = redelivered, - envExchangeName = exchangeName, envRoutingKey = routingKey, envChannel = chan}- - subscriber (msg, env)+ case M.lookup consumerTag s of+ Just subscriber -> do+ let msg = msgFromContentHeaderProperties properties msgBody+ let env = Envelope {envDeliveryTag = deliveryTag, envRedelivered = redelivered,+ envExchangeName = exchangeName, envRoutingKey = routingKey, envChannel = chan}++ subscriber (msg, env)+ Nothing ->+ -- got a message, but have no registered subscriber; so drop it+ return () ) handleAsync (SimpleMethod (Channel_close errorNum (ShortString errorMsg) _ _)) = do
amqp.cabal view
@@ -1,5 +1,5 @@ Name: amqp -Version: 0.2.7 +Version: 0.2.8 Synopsis: Client library for AMQP servers (currently only RabbitMQ) Description: Client library for AMQP servers (currently only RabbitMQ) License: BSD3 @@ -9,6 +9,7 @@ Category: Network Maintainer: Holger Reinhardt <hreinhardt@gmail.com> Build-Type: Simple +Homepage: https://github.com/hreinhardt/amqp Cabal-Version: >=1.2 Extra-source-files: examples/ExampleConsumer.hs, examples/ExampleProducer.hs @@ -17,6 +18,7 @@ Library Build-Depends: base >= 4 && < 5, binary, containers>=0.2, bytestring>=0.9, network>=2.2.3.1 + ghc-options: -O2 Exposed-modules: Network.AMQP, Network.AMQP.Types Other-modules: Network.AMQP.Generated, Network.AMQP.Helpers, Network.AMQP.Protocol