acknowledgement option for autobahn.twisted.wamp.ApplicationSession.publish doesn't work

#1

I’ve crossbar with some “components”:

 {
"type": "class",
"classname": "application.Application",
"realm": "general",
"role": "backend"
}

application.Application - subclass from autobahn.twisted.wamp.ApplicationSession I'm trying publish message through publish method with acknowledgement = True

    @defer.inlineCallbacks
def publish_message_to_client(self, user_id, message, options=PublishOptions(acknowledge=True)):
yield self.publish(WAMP_URI_TEMPLATE.format(user_id), message, options=options)

but I always receive autobahn.wamp.request.Publication instance. Whenever was connected subscriber or not. However docs say that ***"If the publication fails the Deferred/Future will reject with an instance of autobahn.wamp.exception.ApplicationError." ***[docs](http://autobahn.ws/python/reference/autobahn.wamp.html?highlight=acknowledgement#autobahn.wamp.interfaces.IApplicationSession.publish)

What is mean "publication fails" ?
Subscriber wasn’t connected to crossbar and wasn’t received message thus publication was fails and publish method must return autobahn.wamp.exception.ApplicationError instance.

Can you explain this behavior?

0 Likes