|
1 | | -# Helios is topic-based pub/sub server using websocket. |
2 | | -* Subscribe message via websocket |
3 | | -* Publish message via websocket and http |
4 | | - |
5 | | -[](https://travis-ci.org/code13k/helios) |
6 | | - |
7 | | - |
8 | | -## app_config.yml |
9 | | -It's application configuration file. |
10 | | -```yaml |
11 | | -# Server port |
12 | | -port: |
13 | | - sub_ws: 55400 |
14 | | - pub_ws: 55401 |
15 | | - pub_http: 55402 |
16 | | - api_http: 55403 |
17 | | -``` |
18 | | -
|
19 | | -## logback.xml |
20 | | -It's Logback configuration file that is famous logging library. |
21 | | -* You can send error log to Telegram. |
22 | | - 1. Uncomment *Telegram* configuration. |
23 | | - 2. Set value of `<botToken>` and `<chatId>`. |
24 | | - ```xml |
25 | | - <appender name="TELEGRAM" class="com.github.paolodenti.telegram.logback.TelegramAppender"> |
26 | | - <botToken></botToken> |
27 | | - <chatId></chatId> |
28 | | - ... |
29 | | - </appender> |
30 | | - ``` |
31 | | - 3. Insert `<appender-ref ref="TELEGRAM"/>` into `<root>` |
32 | | - ```xml |
33 | | - <root level="WARN"> |
34 | | - <appender-ref ref="FILE"/> |
35 | | - <appender-ref ref="TELEGRAM"/> |
36 | | - </root> |
37 | | - ``` |
38 | | -* You can send error log to Slack. |
39 | | - 1. Uncomment *Slack* configuration. |
40 | | - 2. Set value of `<webhookUri>`. |
41 | | - ```xml |
42 | | - <appender name="SLACK_SYNC" class="com.github.maricn.logback.SlackAppender"> |
43 | | - <webhookUri></webhookUri> |
44 | | - ... |
45 | | - </appender> |
46 | | - ``` |
47 | | - 3. Insert `<appender-ref ref="SLACK"/>` into `<root>` |
48 | | - ```xml |
49 | | - <root level="WARN"> |
50 | | - <appender-ref ref="FILE"/> |
51 | | - <appender-ref ref="SLACK"/> |
52 | | - </root> |
53 | | - ``` |
54 | | -* You can reload configuration but need not to restart application. |
55 | | - |
56 | | - |
57 | | -# Server |
58 | | -Helios has four servers. |
59 | | -One is a subscribing server using websocket, another is a publishing server using websocket, a thrid is a publishing server using http, the fourth is a restful API server using http. |
60 | | - |
61 | | -## Sub Websocket Server |
62 | | -### Usage |
63 | | -```html |
64 | | -ws://example.com:{port}/sub |
65 | | -``` |
66 | | -* port |
67 | | - * Server port |
68 | | - * It's *sub_ws* in app_config.yml. |
69 | | -* command |
70 | | - * SUB {topic} |
71 | | - * UNSUB {topic} |
72 | | - * PING |
73 | | - |
74 | | -### Example |
75 | | -```html |
76 | | -ws://example.com:55401/sub |
77 | | -SUB org.code13k.topic |
78 | | -``` |
79 | | - |
80 | | -## Pub Websocket Server |
81 | | -```html |
82 | | -ws://example.com:{port}/pub/{topic} |
83 | | -``` |
84 | | -* port |
85 | | - * Server port |
86 | | - * It's *pub_ws* in app_config.yml. |
87 | | -* Publish message to specific topic via websocket |
88 | | - |
89 | | -### Example |
90 | | -```html |
91 | | -ws://example.com:55401/pub/org.code13k.topic |
92 | | -``` |
93 | | - |
94 | | -## Pub HTTP Server |
95 | | -```html |
96 | | -http://example.com:{port}/pub/{topic} |
97 | | -``` |
98 | | -* port |
99 | | - * Server port |
100 | | - * It's *pub_http* in app_config.yml. |
101 | | -* Publish message to specific topic. |
102 | | -* Using POST and sending message add body. |
103 | | - |
104 | | - |
105 | | -### Example |
106 | | -```html |
107 | | -http://example.com:55402/pub/org.code13k.topic |
108 | | -``` |
109 | | - |
110 | | -## API HTTP Server |
111 | | -### Usage |
112 | | -```html |
113 | | -http://example.com:{port}/{domain}/{method} |
114 | | -``` |
115 | | - |
116 | | -### Example |
117 | | -```html |
118 | | -http://example.com:55403/app/status |
119 | | -http://example.com:55403/app/hello |
120 | | -http://example.com:55403/app/ping |
121 | | -``` |
122 | | - |
123 | | -### API |
124 | | -#### GET /topic/count |
125 | | -* Get topic count |
126 | | -```json |
127 | | -{"data":15} |
128 | | -``` |
129 | | - |
130 | | -### GET /topic/all |
131 | | -* Get all topic |
132 | | -##### Response |
133 | | -```json |
134 | | -{ |
135 | | - "data": [ |
136 | | - { |
137 | | - "channelCount": 15, |
138 | | - "topic": "primitive.topic.all" |
139 | | - }, |
140 | | - { |
141 | | - "channelCount": 15, |
142 | | - "topic": "org.code13k.topic1" |
143 | | - }, |
144 | | - ... |
145 | | - ] |
146 | | -} |
147 | | -``` |
148 | | - |
149 | | -### GET /topic/search?keyword={KEYWORD} |
150 | | -* Find topic with keyword |
151 | | -##### Response |
152 | | -```json |
153 | | -{ |
154 | | - "data": [ |
155 | | - { |
156 | | - "channelCount": 15, |
157 | | - "topic": "primitive.topic.all" |
158 | | - }, |
159 | | - { |
160 | | - "channelCount": 15, |
161 | | - "topic": "org.code13k.topic1" |
162 | | - }, |
163 | | - ... |
164 | | - ] |
165 | | -} |
166 | | -``` |
167 | | - |
168 | | -#### GET /app/env |
169 | | -* Get application environments |
170 | | -##### Response |
171 | | -```json |
172 | | -{ |
173 | | - "data":{ |
174 | | - "applicationVersion": "1.4.0", |
175 | | - "hostname": "hostname", |
176 | | - "osVersion": "10.11.6", |
177 | | - "jarFile": "code13k-helios-1.0.0-alpha.1.jar", |
178 | | - "javaVersion": "1.8.0_25", |
179 | | - "ip": "192.168.0.121", |
180 | | - "javaVendor": "Oracle Corporation", |
181 | | - "osName": "Mac OS X", |
182 | | - "cpuProcessorCount": 4 |
183 | | - } |
184 | | -} |
185 | | -``` |
186 | | -#### GET /app/status |
187 | | -* Get application status |
188 | | -##### Response |
189 | | -```json |
190 | | -{ |
191 | | - "data":{ |
192 | | - "threadInfo":{...}, |
193 | | - "cpuUsage": 2.88, |
194 | | - "threadCount": 25, |
195 | | - "currentDate": "2018-10-02T01:15:21.290+09:00", |
196 | | - "startedDate": "2018-10-02T01:14:40.995+09:00", |
197 | | - "runningTimeHour": 0, |
198 | | - "vmMemoryUsage":{...} |
199 | | - } |
200 | | -} |
201 | | -``` |
202 | | -#### GET /app/hello |
203 | | -* Hello, World |
204 | | -##### Response |
205 | | -```json |
206 | | -{"data":"world"} |
207 | | -``` |
208 | | -#### GET /app/ping |
209 | | -* Ping-Pong |
210 | | -##### Response |
211 | | -```json |
212 | | -{"data":"pong"} |
| 1 | +# Helios [](https://travis-ci.org/code13k/helios) |
| 2 | +**Helios** is topic-based pub/sub server using WebSocket written in java. |
| 3 | +Helios provide a solution to broadcast message to many subscriber. So it can send many messages to many subscribers. |
| 4 | +Helios has four servers. One is a subscribing server using WebSocket, another is a publishing server using WebSocket, a third is a publishing server using http, the fourth is a restful API server using http. |
213 | 5 |
|
| 6 | +It provide pub method via HTTP and WebSocket. |
| 7 | +You can publish message using HTTP and WebSocket. |
214 | 8 |
|
| 9 | +It provider sub method via WebSocket. |
| 10 | +You can subscribe message using WebSocket. |
215 | 11 |
|
| 12 | +It provide clustering nodes using Hazelcast. |
| 13 | +You can build high availability(HA) systems by clustering node. |
| 14 | + |
| 15 | +* **[Configuration](./doc/configuration.md)** |
| 16 | +* **[Publish Data](./doc/pub_server.md)** |
| 17 | +* **[Subscribe Data](./doc/sub_server.md)** |
| 18 | +* **[API](./doc/api_server.md)** |
| 19 | + |
| 20 | + |
| 21 | +# Latest Release |
| 22 | +The current stable version is ready. |
| 23 | + |
| 24 | +The current unstable version is [v0.2.0-Alpha.1](https://github.com/code13k/helios/releases/tag/0.2.0-Alpha.1) |
| 25 | + |
| 26 | + |
| 27 | +## License |
| 28 | +MIT License |
| 29 | + |
| 30 | +Copyright (c) 2018 Code13K |
| 31 | + |
| 32 | +Permission is hereby granted, free of charge, to any person obtaining a copy |
| 33 | +of this software and associated documentation files (the "Software"), to deal |
| 34 | +in the Software without restriction, including without limitation the rights |
| 35 | +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
| 36 | +copies of the Software, and to permit persons to whom the Software is |
| 37 | +furnished to do so, subject to the following conditions: |
| 38 | + |
| 39 | +The above copyright notice and this permission notice shall be included in all |
| 40 | +copies or substantial portions of the Software. |
| 41 | + |
| 42 | +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| 43 | +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
| 44 | +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
| 45 | +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
| 46 | +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
| 47 | +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE |
| 48 | +SOFTWARE. |
| 49 | + |
| 50 | + |
| 51 | + |
| 52 | + |
0 commit comments