Try ceylon with spring-boot
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.idea
bar
discovery
foo
foobar
gateway
.gitignore
README.md

README.md

Spring Boot and Ceylon

An example Spring Boot service written in Ceylon, demonstrating the use of discovery, gateway, feign client, JPA, dependency injection, etc.

This project is experimental and is being done for fun in my spare time. So don't worry if the microservices don't make sense or look like a overengineering for just a few CRUDs.

The project is divided into the following services:

  • Gateway
  • Discovery
  • Foo
  • Bar
  • FooBar (tests feign client, ribbon, etc)

Requirements

You'll need the following prerequisites to get started:

Compiling

To compile the example, you'll need to type ceylon compile in each service subdirectory. For example, to compile the Gateway service, type:

cd gateway
ceylon compile

Alternatively, you can simply import this project into Eclipse or IntelliJ.

Starting the services

To start a service, go to the service subdirectory, and type ceylon run <name>. For example, to start the Discovery service, type:

cd discovery
ceylon run discovery

To start a service from within the IDE, go to it's run() function, and Run it.

The services must be started in the following order:

  1. First, the discovery service.
  2. Next, foo, bar, and/or foobar.
  3. Finally, the gateway service.

How to use the microservices

An important detail is that the services are not available at the same time that services are UP, this is due to the strategy used by the discovery that consist basically wait 3 beats. So do not be surprised if at first seem that the service was not available. The default standby time is 30 seconds per beat.

{
  "name" : "Any Name Here"
}
{
  "maximumPlaces" : 3
}
{
  "bar" : 1,
  "foo" : 1
}

Enjoy and please open issues if you have problems with configuration.