Skip to content
Permalink
Branch: master
Commits on Jun 18, 2019
  1. fix: fixes bug where replying to a publication after a timeout has be…

    aaslamin authored and primalmotion committed Jun 18, 2019
    …en reached results in a deadlock (#61)
Commits on Jun 17, 2019
  1. new: add ability for subscriber to respond back to publication after …

    aaslamin authored and primalmotion committed Jun 17, 2019
    …processing (#60)
    
    * new: add ability for subscriber to respond back to publication AFTER it has processed the received publication
    
    Signed-off-by: Amir Aslaminejad <amir.a@aporeto.com>
    
    * edit: provide constructor for setting up default natsSubscribeConfig values
    
    Signed-off-by: Amir Aslaminejad <amir.a@aporeto.com>
    
    * 💥 - removed NATSOptSubscribeReplyer option as clients can now reply to a publication
    
    Signed-off-by: Amir Aslaminejad <amir.a@aporeto.com>
    
    * simplify assignment :facepalm:
    
    Signed-off-by: Amir Aslaminejad <amir.a@aporeto.com>
    
    * add stronger assertions to ensure we fail if an error was expected
    
    Signed-off-by: Amir Aslaminejad <amir.a@aporeto.com>
    
    * ensure that the response is not nil
    
    Signed-off-by: Amir Aslaminejad <amir.a@aporeto.com>
    
    * new: send error to error channel if responding with an ACK fails
    
    Signed-off-by: Amir Aslaminejad <amir.a@aporeto.com>
    
    * edit: bump replyTimeout to 60 seconds
    
    Signed-off-by: Amir Aslaminejad <amir.a@aporeto.com>
    
    * fix: update comment copy to remove outdated info
    
    Signed-off-by: Amir Aslaminejad <amir.a@aporeto.com>
    
    * new: add test coverage for scenario: should NOT receive anything in publication channel if responding back with an ACK fails
    
    Signed-off-by: Amir Aslaminejad <amir.a@aporeto.com>
    
    * new: add test coverage for scenario: should be able to respond back to a publication manually
    
    Signed-off-by: Amir Aslaminejad <amir.a@aporeto.com>
    
    * new: add test for scenario: should receive error in errors channel if publishing manual response fails for whatever reason
    
    Signed-off-by: Amir Aslaminejad <amir.a@aporeto.com>
    
    * new: add logic to cover case where client code calls Reply more than once for a given publication - in this case we want to error as the message handler will no longer be reading off the channel
    
    Signed-off-by: Amir Aslaminejad <amir.a@aporeto.com>
    
    * new: add test coverage for the Publication Reply method
    
    Signed-off-by: Amir Aslaminejad <amir.a@aporeto.com>
Commits on Jun 11, 2019
  1. NATS PubSub - adds ability to distinguish between different Publish r…

    aaslamin committed Jun 11, 2019
    …equests (#59)
    
    * new: adds ability to distinguish between different Publish requests when using the NATS request-reply messaging
    
    • NATSOptPublishRequireAck option

    When configured, it will set the ResponseMode field of the Publication to “ResponseModeACK”. The side effect of this is that caller of Publish will now block until an ACK is received or the supplied context deadline is reached. As a result of this option our implementation of Subscribe will now need to look for this new ResponseMode attribute when consuming messages to determine whether it needs to respond back with an ACK. This option is mutually exclusive with the NATSOptRespondToChannel option.
    
    • NATSOptRespondToChannel option

    When configured, it will set the ResponseMode field of the Publication to “ResponseModePublication”. The side effect of this is that caller of Publish will now block until a Publication response is received or the supplied context deadline is reached. As a result of this option our implementation of Subscribe will now need to look for the new ResponseMode attribute and check to see if it is expected to response back with a Publication response. This option is mutually exclusive with the NATSOptPublishRequireAck option.
    
    breaking: removed the NATSOptPublishReplyValidator publish option as it now serves no purpose. Folks should either use NATSOptPublishRequireAck or NATSOptRespondToChannel now. As a result, the replyValidator attribute from the publish configuration has been removed as well.
    Signed-off-by: Amir Aslaminejad <amir.a@aporeto.com>
    
    * new: add test coverage for scenario: should return an error if response is not a valid ACK response when using the NATSOptPublishRequireAck option
    
    Signed-off-by: Amir Aslaminejad <amir.a@aporeto.com>
Commits on May 29, 2019
  1. new: add ability for caller to get back received raw *nats.Msg to a c…

    aaslamin authored and primalmotion committed May 29, 2019
    …hannel (#56)
    
    * new: add ability for caller to get back received raw *nats.Msg to a channel they provide when using the request-reply mode
    
    Signed-off-by: Amir Aslaminejad <amir.a@aporeto.com>
    
    * update response channel type to *Publication to be consistent with our Publish API - when using the Request-Reply pattern, the response is expected to be a Publication as well
    
    Signed-off-by: Amir Aslaminejad <amir.a@aporeto.com>
    
    * new: add test coverage for scenario: should return an error if the response could not be decoded into a Publication when using the NATSOptRespondToChannel option
    
    Signed-off-by: Amir Aslaminejad <amir.a@aporeto.com>
Commits on May 24, 2019
  1. new: add test coverage for scenario: should receive an error in error…

    aaslamin authored and primalmotion committed May 24, 2019
    …s channel if subscribing fails for any reason (#55)
    
    Signed-off-by: Amir Aslaminejad <amir.a@aporeto.com>
Commits on May 22, 2019
Commits on May 21, 2019
  1. unit test coverage for PubSubClient NATS implementation Publish method (

    aaslamin authored and primalmotion committed May 21, 2019
    #52)
    
    * new: add client interface for NATS
    
    Signed-off-by: Amir Aslaminejad <amir.a@aporeto.com>
    
    * new: generate mock for NATS client
    
    Signed-off-by: Amir Aslaminejad <amir.a@aporeto.com>
    
    * new:
    
    • add option for setting the connection retry interval - NATSOptConnectRetryInterval
    • add test coverage for NATSOptConnectRetryInterval option
    
    Signed-off-by: Amir Aslaminejad <amir.a@aporeto.com>
    
    * new: add stronger assertions to ensure that the generated client id is actually a V4 UUID
    
    Signed-off-by: Amir Aslaminejad <amir.a@aporeto.com>
    
    * new: add option for overriding the NATS client - particularly useful for unit testing
    
    Signed-off-by: Amir Aslaminejad <amir.a@aporeto.com>
    
    * ignore .idea/* from git
    
    * new: add test coverage for pubsub nats Publish - scenario: should successfully publish publication
    
    Signed-off-by: Amir Aslaminejad <amir.a@aporeto.com>
    
    * new:
    
    • add error type for NoClientError - make it possible for consumers to properly handle errors
    • add error type for EncodingError - make it possible for consumers to properly handle errors
    
    Signed-off-by: Amir Aslaminejad <amir.a@aporeto.com>
    
    * new: add test coverage for pubsub nats Publish - scenario: should return a NoClientError error if no NATS client had been connected
    
    Signed-off-by: Amir Aslaminejad <amir.a@aporeto.com>
    
    * new: add test coverage for pubsub nats Publish - scenario: should return an EncodingError error if the publication fails to get encoded
    
    Signed-off-by: Amir Aslaminejad <amir.a@aporeto.com>
    
    * new: add test coverage for pubsub nats Publish - scenario: should be able to provide a custom reply validator using the NATSOptPublishRequireAck option
    
    Signed-off-by: Amir Aslaminejad <amir.a@aporeto.com>
    
    * new: add test coverage for pubsub nats Publish - scenario: should return an error if custom response validator fails response message validation
    
    Signed-off-by: Amir Aslaminejad <amir.a@aporeto.com>
    
    * new: add test coverage for pubsub nats Publish - scenario: should return an error if RequestWithContext returns an error
    
    Signed-off-by: Amir Aslaminejad <amir.a@aporeto.com>
    
    * new: add test coverage for pubsub nats Publish - scenario: should return an error if Publish returns an error
    
    Signed-off-by: Amir Aslaminejad <amir.a@aporeto.com>
    
    * fix: don't export NATSOption that enables the overriding the NATS client
    
    Signed-off-by: Amir Aslaminejad <amir.a@aporeto.com>
    
    * fix: remove custom error types for now
    
    Signed-off-by: Amir Aslaminejad <amir.a@aporeto.com>
You can’t perform that action at this time.