Commit 5574836d authored by Matteo Quintiliani's avatar Matteo Quintiliani
Browse files

Merge branch 'hotfix/1.11.2'

parents e4210590 d83c5584
Pipeline #5101 failed with stages
in 46 seconds
......@@ -2,9 +2,10 @@
ew2openapi Release History
#########################
* Release 1.11.1 (2020/03/12)
* Release 1.11.2 (2020/05/20)
- Under development reading extra fields in ARC structure related to magnitude values. Issue #25 (2020/03/12)
- Hotfix 1.11.1: Fix make -f makefile.unix test for ARC_EXTRA_FIELDS . Issue #25 (2020/03/12)
- Hotfix 1.11.1: Fix make -f makefile.unix test for ARC_EXTRA_FIELDS. Issue #25 (2020/03/12)
- Hotfix 1.11.2: Improve README.md. (2020/05/20)
* Release 1.10.4 (2020/03/11)
- Remove dependency from EW_LOG and logit() when run as stand-alone mode. Issue #15 (2018/04/24)
......
# ew2openapi
Earthworm module for transporting Earthworm messages from rings to:
- ew2openapi Webservice
- RabbitMQ exchanges
- JSON files
- QuakeDB OpenAPI Webservice (Dante)
- RabbitMQ exchanges (Raw Earthworm message, Converted JSON or GeoJSON messages)
- Converted JSON or GeoJSON files
- *TODO: Apache Kafka, OSC.*
Earthworm messages can optionally be converted in JSON format. GeoJSON format could be also used but only when geographic references are directly or inderictely available for a specific message type.
Earthworm messages can optionally be converted in JSON format.
[[_TOC_]]
## Usage
`ew2openapi` can be used in two different ways:
- launched as an Earthworm module to redirect data into webservices or RabbitMQ
- stand-alone to convert Earthworm message to JSON ew2openapi format
1. Launched as an Earthworm module to redirect data into QuakeDB OpenAPI Webservices or RabbitMQ systems.
2. Stand-alone to convert Earthworm message to JSON ew2openapi format
#### ew2openapi as Earthworm module
#### Earthworm module
```sh
ew2openapi ew2openapi.d
```
#### ew2openapi as stand-alone command-line conversion tool
#### Stand-alone JSON command-line conversion tool
```sh
ew2openapi TYPE_HYP2000ARC ./20180205-080122.0009627.arc ./20180205-080122.0009627.json 2> out.log
......@@ -83,24 +86,34 @@ make -f makefile.ux
Templates `.d` and `.desc` files for ew2openapi configuration are available within the directory `params` of the current repository.
#### ew2openapi and RabbitMQ configuration
#### Common configuration parameters
```sh
MyModuleId MOD_EW2OPENAPI # module id for this program
# Multiple declaration of InRing. The first one is used for reporting
# heartbeat and status messages. Be careful with messages duplicated
# in different rings.
InRing WAVE_RING # transport ring to use for input
InRing PICK_RING # transport ring to use for input
InRing HYPO_RING # transport ring to use for input
# Earlybird Message types
# InRing ALARM_RING # transport ring to use for input
HeartBeatInt 30 # EW internal heartbeat interval (sec)
LogFile 1 # If 0, don't write logfile
# if 2, write to module log but not to
# stderr/stdout .
```
```sh
# Unique name that indentifies the EW instance is usually declared as variable. Inherit from Mole.
EWInstanceName ${EWMOLE_INSTANCENAME}
#
# Rabbit DB connection parameters
RMQHostname ${RABBITMQ_HOSTNAME}
RMQPort ${RABBITMQ_PORT}
RMQExchange ${RABBITMQ_EXCHANGE}
RMQVirtualHost ${RABBITMQ_VIRTUALHOST}
RMQUsername ${RABBITMQUSER}
RMQPassword ${RABBITMQPASS}
```
Select message types to read.
```
```sh
# Message types usually read from PICK_RING
GetMsgLogo ${EW_INSTALLATION} MOD_WILDCARD TYPE_PICK_SCNL
GetMsgLogo ${EW_INSTALLATION} MOD_WILDCARD TYPE_CODA_SCNL
......@@ -127,7 +140,7 @@ Select message types to read.
Set which format to use to convert Earthworm message.
```
```sh
# SendMessageFormat declare which format use to convert Earthworm messages and send to RabbitMQ server.
# If no SendMessageFormat is declared then default is only RAW.
# Available message conversion format are RAW, JSON or GeoJSON. JSON and GeoJSON arei mutually exclusive.
......@@ -143,17 +156,43 @@ SendMessageFormat JSON
# SendMessageFormat GeoJSON
```
```sh
# Station list needed only for GeoJSON conversion
maxsite 3500
site_file all_stations.hinv
```
#### QuakeDB OpenAPI parameters
```sh
# ew2openapi connection parameter
ApiBaseUrl ${EW2OPENAPI_APIBASEURL}
```
#### RabbitMQ parameters
```sh
# Rabbit DB connection parameters
RMQHostname ${RABBITMQ_HOSTNAME}
RMQPort ${RABBITMQ_PORT}
RMQExchange ${RABBITMQ_EXCHANGE}
RMQVirtualHost ${RABBITMQ_VIRTUALHOST}
RMQUsername ${RABBITMQUSER}
RMQPassword ${RABBITMQPASS}
```
#### RabbitMQ Routing key
Earthworm messages are automatically redirected to routing key based on the following rule:
```
```sh
EW.<ewInstance>.<ringName>.<instName>.<modName>.<logoTypeName>.<messageFormat>
```
Some examples:
```
```sh
EW.hew3_mole.PICK_RING.INST_INGV.MOD_BINDER_EW.TYPE_QUAKE2K.RAW
EW.hew3_mole.WAVE_RING.INST_INGV.MOD_GAPLIST.TYPE_HEARTBEAT.JSON
EW.hew3_mole.HYPO_RING.INST_INGV.MOD_EQASSEMBLE.TYPE_HYP2000ARC.GEOJSON
......@@ -168,7 +207,7 @@ Each Earthworm message is converted in a JSON object which contains all fields o
Example of TYPE_HEARTBEAT Earthworm message:
```
```json
{
"ewLogo":{
"type":"TYPE_HEARTBEAT",
......@@ -189,7 +228,7 @@ Example of TYPE_HEARTBEAT Earthworm message:
Example of TYPE_ERROR Earthworm message:
```
```json
{
"ewLogo":{
"type":"TYPE_ERROR",
......@@ -210,7 +249,7 @@ Example of TYPE_ERROR Earthworm message:
Example of TYPE_PICK_SCNL Earthworm message:
```
```json
{
"ewLogo":{
"type":"TYPE_PICK_SCNL",
......@@ -242,7 +281,7 @@ Example of TYPE_PICK_SCNL Earthworm message:
Example of TYPE_LINK Earthworm message:
```
```json
{
"ewLogo":{
"type":"TYPE_LINK",
......@@ -264,7 +303,7 @@ Example of TYPE_LINK Earthworm message:
Example of TYPE_QUAKE2K Earthworm message:
```
```json
{
"ewLogo":{
"type":"TYPE_QUAKE2K",
......@@ -294,7 +333,7 @@ Example of TYPE_QUAKE2K Earthworm message:
Example of TYPE_HYP2000ARC Earthworm message:
```
```json
{
"ewLogo":{
"type":"TYPE_HYP2000ARC",
......@@ -439,7 +478,7 @@ Example of TYPE_HYP2000ARC Earthworm message:
Example of TYPE_MAGNITUDE Earthworm message:
```
```json
{
"ewLogo":{
"type":"TYPE_MAGNITUDE",
......@@ -539,7 +578,7 @@ Example of TYPE_MAGNITUDE Earthworm message:
Example of TYPE_STRONGMOTIONII Earthworm message:
```
```json
{
"ewLogo": {
"type": "TYPE_STRONGMOTIONII",
......@@ -585,11 +624,11 @@ Example of TYPE_STRONGMOTIONII Earthworm message:
## GeoJSON Earthworm message conversion
GeoJSON conversion encapsulate JSON Earthworm message conversion within the field `properties` of a `FeatureCollection`.
GeoJSON conversion encapsulate JSON Earthworm message conversion within the field `properties` of a `FeatureCollection`. GeoJSON format can be used only when geographic references are available within a specific message type, or inderictely derived by a hypoinverse station file.
An example for a TYPE_QUAKE2K message is:
```
```json
{
"type":"FeatureCollection",
"features":[
......
1.11.1 - 2020-03-12
\ No newline at end of file
1.11.2 - 2020-05-20
\ No newline at end of file
Subproject commit 985c46fec39d1d3043f98e8d8cdb9d040131b3bb
Subproject commit 0daf8dc826495ba3e329d594ea7ea18456d4a5b7
/* DO NOT EDIT. Automatically generated. Change file HISTORY in ew2openapi_version main directory. */
#define EW2OPENAPI_VERSION "1.11.1 - 2020-03-12"
#define EW2OPENAPI_VERSION "1.11.2 - 2020-05-20"
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment