[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Changing routing SPI call



We realized yesterday that the add_gear mcollective call doesn't have a gear ID on it, so you can't construct a URL to the public gear DNS (<gearid>-<domain>.<suffix>) from the routing SPI endpoint.  As I was doing that I noticed that we were still calling it add_gear, when it's really add_public_endpoint, which I would like to change.

I'd like to maintain backward compatibility of the SPI wherever possible, so I was going to send both old and new message ids as two messages.  So where before you would get:

      {
        :action => :add_gear,
        :app_name => app.name,
        :namespace => app.domain.namespace,
        :public_port_name => endpoint_name,
        :public_address => public_ip,
        :public_port => public_port,
        :protocols => protocols,
        :types => types,
        :mappings => mappings
      }

now you'll get that, AND:

      {
        :action => :add_public_endpoint,
        :app_name => app.name,
        :namespace => app.domain.namespace,
        :public_port_name => endpoint_name,
        :public_address => public_ip,
        :public_port => public_port,
        :protocols => protocols,
        :types => types,
        :mappings => mappings
      }

Listen to one or the other, but not both.  The same applies for delete_gear and remove_public_endpoint.  We will deprecate add_gear and delete_gear in 2.0.2 enterprise, and remove it in 2.2 enterprise (origin 4 probably).

Also, we need to add the gear identifier to each endpoint that is published so that a consumer can construct a gear specific URL.  To do that, the RoutingService API will change in a non-backwards compatible manner - anyone implementing a custom RoutingProvider (i.e, not using activemq_routing_plugin) will have an API change in 2.0.2 enterprise / upcoming master.  These are the methods that will change:

    def notify_create_public_endpoint(app, endpoint_name, public_ip, public_port, protocols, types, mappings)
    def notify_delete_public_endpoint(app, public_ip, public_port)

to 

    def notify_create_public_endpoint(app, gear, endpoint_name, public_ip, public_port, protocols, types, mappings)
    def notify_delete_public_endpoint(app, gear, public_ip, public_port)

The gear identifier will be sent as gear_id in the affected messages.

Any concerns or questions?


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]