cf-java-client icon indicating copy to clipboard operation
cf-java-client copied to clipboard

Missing support for MultiServiceRegistration

Open gberche-orange opened this issue 5 years ago • 2 comments
trafficstars

  • As a cf-java-client user,

  • in order to interact with service whose name is declared from multiple brokers,

  • I need the methods accepting a serviceName to accept an additional serviceBrokerName:

    • org.cloudfoundry.operations.services.DefaultServices#listServiceOfferings
    • org.springframework.cloud.appbroker.acceptance.fixtures.cf.CloudFoundryService#createServiceInstance
    • org.springframework.cloud.appbroker.acceptance.fixtures.cf.CloudFoundryService#deleteServiceInstance
    • org.cloudfoundry.operations.services.DefaultServices#getServiceIdByName
    • org.cloudfoundry.operations.services.DefaultServices#getSpaceService
    • org.cloudfoundry.operations.serviceadmin.DefaultServiceAdmin#enableServiceAccess org.cloudfoundry.operations.serviceadmin.DefaultServiceAdmin#disableServiceAccess
  • And I need some response objects to include a service broker field

    • ServiceInstanceSummary

The related "Multi-Service Registration" feature was added by SAPI team see related user-facing manual, related epic and support by CF CLI in release v6.43.0 :

CF now allows multiple service brokers to offer services with the same name and or to have the same catalogs. (However, brokers themselves must still be given a unique name.)

Note: Multi-service registration is only supported on CC API version 2.125.0 or greater.

Users can specify which broker to use with a new -b flag, which is available on the following commands: cf create-service cf enable-service-access cf disable-service-access cf purge-service-offering cf service - now display broker names cf marketplace now display broker names

Important Note: If you have two services with the same name, the commands above will now require the -b flag to disambiguate which service and broker you want to operate on.

gberche-orange avatar Dec 09 '19 17:12 gberche-orange

Symptom (in version 4.2.0) of this limitation when the equivalent of cf enable-service-access is invoked while there are services from multiple service brokers matching:

16-03-2020 17:12:30.057 [cloudfoundry-client-epoll-3] ERROR o.s.c.a.a.f.cf.CloudFoundryService.lambda$enableServiceBrokerAccess$1 - Error enabling access to service app-service-create-instance-with-services: java.lang.IndexOutOfBoundsException: Source emitted more than one item
16-03-2020 17:25:27.724 [cloudfoundry-client-epoll-3] DEBUG o.s.c.a.a.CloudFoundryAcceptanceTest.lambda$blockingSubscribe$8 - error subscribing to publisher
java.lang.IndexOutOfBoundsException: Source emitted more than one item
	at reactor.core.publisher.MonoSingle$SingleSubscriber.onNext(MonoSingle.java:129)
	Suppressed: reactor.core.publisher.FluxOnAssembly$OnAssemblyException: 
Assembly trace from producer [reactor.core.publisher.MonoDoFinally] :
	reactor.core.publisher.Mono.checkpoint(Mono.java:1862)
	org.cloudfoundry.operations.serviceadmin.DefaultServiceAdmin.enableServiceAccess(DefaultServiceAdmin.java:129)
Error has been observed at the following site(s):
	|_ Mono.checkpoint ⇢ at org.cloudfoundry.operations.serviceadmin.DefaultServiceAdmin.enableServiceAccess(DefaultServiceAdmin.java:129)

gberche-orange avatar Mar 16 '20 16:03 gberche-orange

Acknowledged as an enhancement.

dmikusa avatar Jan 18 '22 17:01 dmikusa