[ https://issues.apache.org/jira/browse/PROTON-2218?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17105761#comment-17105761 ]
Jiri Daněk commented on PROTON-2218: ------------------------------------ bq. Without calling container.run() can I just use the connection that container.connect returns? Yes, but you can only use it from the {{on_...}} handlers, and you need the proton eventloop running, which means calling {{container.run()}}. bq. What If I want to setup a connection only when a rest endpoint gets called and then send a message? This sounds like the the interactive example, https://github.com/apache/qpid-proton/blob/7abcfc7aba6cfd1c938324cf34a51555c845a589/python/examples/tx_recv_interactive.py#L76-L83. You'd have your rest endpoint triggering events inside the proton eventloop using EventInjector. bq. Problem is the rest of the team is using BlockingConnection for dev purposes and I have been tasked to add the failover with. How do you know you need to failover, when using BlockingConnection? You get an exception that you were disconnected. So add a try: except block, catch the exception, and connect again, essentially. That way you can keep using BlockingConnection. > Connector.user and Connector.Password are None > ---------------------------------------------- > > Key: PROTON-2218 > URL: https://issues.apache.org/jira/browse/PROTON-2218 > Project: Qpid Proton > Issue Type: Bug > Components: python-binding > Affects Versions: proton-c-0.30.0 > Reporter: Angelo Mendonca > Assignee: Jiri Daněk > Priority: Major > Attachments: image-2020-05-12-14-18-33-313.png, jd_answer_1.png > > > > {noformat} > connector.user = kwargs.get('user', self.user) > print("User", kwargs.get('user', self.user)) > print(connector.user) > connector.password = kwargs.get('password', self.password) > print("password", kwargs.get('password', self.password)) > print(connector.password){noformat} > [https://github.com/apache/qpid-proton/blob/4265cc7ab8391630b47da2de4c1ead2f28763980/python/proton/_reactor.py#L1264] > > [https://github.com/apache/qpid-proton/blob/4265cc7ab8391630b47da2de4c1ead2f28763980/python/proton/_reactor.py#L1265] > > Dont see to exist in kwargs although the print statement just above the > kwargs.get shows that user and password exist... > The output is below.. > > {code:java} > KWARGS {'kwargs': {'sasl_enabled': True, 'allow_insecure_mechs': True, > 'password': 'DFfoSQM2ZYlLqCLm', 'user': 'DsWPjfKALYgKmtwsVGHBceceygn'}} > User None > None > password None > None > {code} > > The Code setups a container connection.. > !image-2020-05-12-14-18-33-313.png! > > No idea why the user and password are not being set although kwagrs contains > both the keys....I am trying to get failover to work with AWS Amazon MQ. Does > BlockingConnection let you work with multiple URLS? Or do I need to use > "container.connect"? > -- This message was sent by Atlassian Jira (v8.3.4#803005) --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@qpid.apache.org For additional commands, e-mail: dev-h...@qpid.apache.org