This is a branch for preparing release 1.0 - check the milestone
An opinionated, full-stacked Microservices framework for node, powered by TypeScript.
import * as island from 'island';
import * as keeper from 'island-keeper';
import { EndpointController } from './controller/endpoint.controller';
import { EventController } from './controller/event.controller';
const serviceName = 'hawaii';
class HawaiiIslet extends island.Islet {
main() {
const islandKeeper = keeper.IslandKeeper.getInst();
islandKeeper.init('consul', 'island');
islandKeeper.setServiceName(serviceName);
const amqpChannelPoolAdapter = new island.AmqpChannelPoolAdapter({url: 'amqp://rabbitmq:5672'});
this.registerAdapter('amqpChannelPool', amqpChannelPoolAdapter);
const rpcAdapter = new island.RPCAdapter({amqpChannelPoolAdapter, serviceName});
rpcAdapter.registerController(EndpointController);
this.registerAdapter('rpc', rpcAdapter);
const eventAdapter = new island.EventAdapter({amqpChannelPoolAdapter, serviceName});
eventAdapter.registerController(EventController);
this.registerAdapter('event', eventAdapter);
}
}
island.Islet.run(HawaiiIslet);
$ npm install island --save
- Free from service discovery
- Support various types of communication
- RPC(strong link between islands)
- Event(weak link between islands)
- Push messaging(to user) via
socket.io
- Ensure that each island gets proper parameters
- Track communications per each request
- Chain contexts with UUID per each request
Loggers
is no longer a part ofisland
-> island-loggers #14Di
is no longer a part ofisland
-> island-di #16@endpoint
decorator now provides 4 more methods #28@endpoint('GET /test')
still works@endpoint.get('/test')
- You can omit the GET method@endpoint.post('/test')
- You can omit the POST method@endpoint.put('/test')
- You can omit the PUT method@endpoint.del('/test')
- You can omit the DEL method
- Require TypeScript@2.x
strictNullChecks
In order to build the island, ensure that you have Git and Node.js installed.
Clone a copy of the repo:
$ git clone https://github.com/spearhead-ea/island.git
Change to the island directory:
$ cd island
Install prerequisites and dev dependencies:
$ npm install -g gulp typescript
$ npm install
To run the test suite, first install the dependencies, then run npm test
:
$ npm install
$ RABBITMQ_HOST=localhost npm test
Environment | Notes |
---|---|
NODE_ENV |
When development , allows APIs which has options.developmentOnly |
HOSTNAME |
TraceLog uses this as a name of node |
ISLAND_RPC_EXEC_TIMEOUT_MS |
Timeout during execution (Defaults to 25000) |
ISLAND_RPC_WAIT_TIMEOUT_MS |
Timeout during call (Defaults to 60000) |
ISLAND_LOGGER_LEVEL |
Logger level of category island |
ISLAND_TRACEMQ_HOST |
MQ(formatted by amqp URI) for TraceLog. If omitted it doesn't log |
ISLAND_TRACEMQ_QUEUE |
A queue name to log TraceLog |
For details on our planned features and future direction please refer to our milestones
The original author of island
is Wonshik Kim
The current lead maintainer is Kei Son