Code Monkey home page Code Monkey logo

generic-service-broker's Introduction

Generic Service Broker

Use this generic service broker to expose services to your Cloud native applications, using the Open Service Broker API. Using a service broker, your applications are not tied to a specific service: you are free to update the target service, without having to replace the service definition in client applications.

Service brokers are featured in modern Cloud platforms such as Cloud Foundry or Kubernetes (Service Catalog). Thanks to this project, you are free to expose any services to your Cloud native applications.

Let's say you have a database running in a legacy server. You want to access this database from your Cloud Native applications: you may use a direct reference to this database. Doing that, all your applications need to know where to find the database (host name or IP address), and how to connect to the service (credentials).

Using a service broker allows you to remove that hard dependency between your database and your applications. The service broker is the only component which knows how to connect to the database. Your applications now just ask the service broker to provide a link to some database service.

If you update the target service definition (for example: the database is running on a different machine, the credentials are changed), your Cloud native applications do not require an update.

Use this project to connect any services (especially those running outside of your Cloud platform) to your applications.

Note When using PostgreSQL, this service broker creates on-demand schemas, so that each client application has its own namespace for creating tables.

How to use it?

This project requires JDK 8:

$ ./mvnw clean package

Deploy to Cloud Foundry

Just push the main JAR file to Cloud Foundry:

$ cf push --no-start

Make sure you use a different application name if you need to expose different services. Update the manifest if required.

You need to set environment variables to define the service you want to expose:

$ cf set-env generic-service-broker KEY VALUE

The following properties can be set:

Key Value
BROKER_SERVICE_URL URL to the exposed service (eg: jdbc:mysql://mydb)
BROKER_SERVICE_ID Service identifier (no space)
BROKER_SERVICE_NAME Service name
BROKER_SERVICE_DESCRIPTION Service description
BROKER_SERVICE_ICON URL to the service icon
BROKER_SERVICE_TAG Service tag
BROKER_SERVICE_PROVIDER String identifying the service provider
BROKER_CREDENTIALS_PASSWORD Admin password

Don't forget to restage the broker when you're done setting properties:

$ cf restage generic-service-broker

Register this application as a space-scoped service broker:

$ cf create-service-broker generic-service-broker \
  admin $ADMIN_PASSWORD https://path.to.service.broker --space-scoped

You are now ready to use your service broker. Just create a new service instance, and bind it to your applications.

Contribute

Contributions are always welcome!

Feel free to open issues & send PR.

License

Copyright © 2019 Pivotal Software, Inc.

This project is licensed under the Apache Software License version 2.0.

generic-service-broker's People

Contributors

alexandreroman avatar

Watchers

 avatar  avatar  avatar

Forkers

aspineon

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.