Search code examples
cloud-foundrypaaspcfcf-bosh

What is the difference of a cloudfoundry "service broker" and its "service broker worker"?


Most of the cloudfoundry service tiles install a service broker AND a service broker worker.

I understand that the broker is receiving Service Broker API requests from the Cloud Controller (CC), and hosts the primary dashboard UI for all service types. So the broker registers with the marketplace and on a create-instance creates vms and installs the service on them and offers UI parts for managing the instances.

But what exactly is the responsibility of the broker worker?
With which components is it communicating when and why?


Solution

  • The broker worker, like with the Spring Cloud Services tile, is responsible for doing the work that might take a long time. Rather than tying up a thread in the broker to do this, it's handed off to the broker worker which processes the tasks.

    But what exactly is the responsibility of the broker worker?

    It depends on the tile, but most likely the broker worker is going to be responsible for creating the actual backing resources for the service. Again, in the case of Spring Cloud Services, it's the broker worker that manages the backing service application instances.

    https://docs.pivotal.io/spring-cloud-services/1-5/service-broker-and-instances.html#service-instance-management

    Other tiles/brokers workers may do different things, but this is generally going to be where the expensive work to set up a service happens.

    With which components is it communicating when and why?

    This will be more specific to the tile. In the case of SCS, the broker worker is primarily talking to the API (i.e. Cloud Controller) to manage backing service application instances. That said, a broker worker could do all sorts of things. Call out to AWS or another IaaS to create something, call out to Bosh to dynamically deploy something, etc. It just depends on what the service tile is going to do.

    Hope that helps!