Stream Zaptec Service Bus messages#39
Open
martijnversluis wants to merge 5 commits into
Open
Conversation
Add a complete(message) method that deletes the lock at the URL the Service Bus returns in the Location header during peek-lock, and surface that URL on Message as lock_location so callers can ack a message only once the downstream handler has accepted it. In consume (receive-and- delete) mode lock_location stays nil.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds the building blocks to consume the per-user-group Azure Service Bus subscription that Zaptec exposes for realtime device observations (docs).
Zaptec::Client#user_groups— lists user groups visible to the authenticated accountZaptec::Client#messaging_connection_details(user_group_id)— fetches the per-group Service Bus credentials (host, topic, subscription, SAS key)Zaptec::MessagingSubscription— polls/messages/headover REST with auto-refreshing SAS tokens, parses the DataContractSerializer-wrapped JSON body, and translatesStateId/DeviceTypeto a human-readable name viaZaptec::ConstantsZaptec::UserGroupandZaptec::MessagingConnectionDetailsvalue objectsREST polling (peek-lock or receive-and-delete) instead of AMQP 1.0 to avoid pulling in a C extension. Trade-off: slightly higher latency than push, but works with stdlib
Net::HTTPand is easy to debug. Can be swapped for AMQP later if needed.Used by stekker/stekker#7847, which wires this into a long-running consumer that logs every message to Elastic as a first PoC for replacing the Zaptec REST polling.