Ejemplo n.º 1
0
 def on_start(self, event):
     """
     Creates the receiver
     :param event:
     :return:
     """
     subs_opts = None
     if self.durable:
         subs_opts = DurableSubscription()
     self.receiver = event.container.create_receiver(self.url,
                                                     name=self.container_id,
                                                     options=subs_opts)
     self.connection = self.receiver.connection
Ejemplo n.º 2
0
    def on_start(self, event):
        # Set the client id So that It is easy to Identify.
        event.container.container_id = self.oAmqpClient.sClientId
        conn = event.container.connect(urls=self.oAmqpClient.lUrls, heartbeat=1000)

        if self.oAmqpClient.bDurableSubscription:
            durable = DurableSubscription()
            if self.oAmqpClient.isTopic:
                event.container.create_receiver(conn, self.oAmqpClient.sTopicName, options=durable)
            else:
                event.container.create_receiver(conn, self.oAmqpClient.sQueueName, options=durable)
        else:
            event.container.create_receiver(conn, self.oAmqpClient.sTopicName)
Ejemplo n.º 3
0
 def on_start(self, event):
     if self.dur_id is not None:
         durable = DurableSubscription()
         event.container.container_id = self.dur_id
         conn = event.container.connect(self.conn_url)
         event.container.create_receiver(
             conn,
             self.address,
             name=self.dur_id,
             options=durable
         )
     else:
         conn = event.container.connect(self.conn_url)
         event.container.create_receiver(conn, self.address)
Ejemplo n.º 4
0
 def on_start(self, event):
     # See:
     # http://qpid.2158936.n2.nabble.com/
     # Connecting-to-durable-consumer-Qpid-Proton-Python-td7659185.html
     # for an explanation of the steps required to create and retain a durable
     # subscription.
     recv_opts = self.selector and [self.selector] or []
     if self.subscription_name:
         event.container.container_id = self.subscription_name
         recv_opts.append(DurableSubscription())
     conn = event.container.connect(urls=self.urls,
                                    ssl_domain=self.ssl_domain,
                                    heartbeat=500)
     event.container.create_receiver(conn, self.address,
                                     name=self.subscription_name,
                                     options=recv_opts)
    def on_start(self, event):
        if self.subscription_name:
            logging.debug("Naming durable subscription " +
                          self.subscription_name)
            durable = DurableSubscription()
        else:
            logging.debug("Subscription will not be durable")
            durable = None

        event.container.container_id = self.subscription_name

        messaging_connection = event.container.connect(self.url)
        event.container.create_receiver(messaging_connection,
                                        self.resource,
                                        name=self.subscription_name,
                                        options=durable)
        logging.debug("Connected to " + clean_url(self.url) + " " +
                      self.resource)