Commit 07349234 authored by Matteo Quintiliani's avatar Matteo Quintiliani
Browse files

Merge branch 'release/1.10.0'

parents 1254a49b 3faea8d7
Pipeline #2907 passed with stages
in 2 minutes and 27 seconds
......@@ -45,7 +45,7 @@ build:
# Configure and build json-c
- cd json-c
- sh autogen.sh
- ./configure --prefix=`pwd`/build
- ./configure --prefix=`pwd`/build CFLAGS="-std=c99"
- make
- make install
- cd -
......@@ -85,6 +85,18 @@ test:
- . $EW_INSTALL_HOME/$EW_INSTALL_VERSION/environment/ew_linux.bash
# Run ew2openapi without argument
- ./ew2openapi
# Test ew2openapi standalone with TYPE_PICK_SCNL input file
- ew2openapi TYPE_PICK_SCNL ./test/pick_ew/message.pick_scnl ./test/json/output_test.json
- jq '.' ./test/json/output_test.json > j1.json
- jq '.' ./test/json/message.pick_scnl.json > j2.json
# Test ew2openapi standalone with TYPE_QUAKE2K input file
- ew2openapi TYPE_QUAKE2K ./test/binder_ew/message.quake2k ./test/json/output_test.json
- jq '.' ./test/json/output_test.json > j1.json
- jq '.' ./test/json/message.quake2k.json > j2.json
# Test ew2openapi standalone with TYPE_LINK input file
- ew2openapi TYPE_LINK ./test/binder_ew/message.link ./test/json/output_test.json
- jq '.' ./test/json/output_test.json > j1.json
- jq '.' ./test/json/message.link.json > j2.json
# Test ew2openapi standalone with ARC input file
- ./ew2openapi TYPE_HYP2000ARC ./test/arc/20180205-080122.0009627.arc ./test/json/output_test.json
- jq '.' ./test/json/output_test.json > j1.json
......@@ -94,4 +106,17 @@ test:
- grep -w -v "hostname" j1.json > jj1.json
- grep -w -v "hostname" j2.json > jj2.json
- diff jj1.json jj2.json
# Test ew2openapi standalone with TYPE_MAGNITUDE input file
- ew2openapi TYPE_MAGNITUDE ./test/localmag/lm_75662.localmag ./test/json/output_test.json
- jq '.' ./test/json/output_test.json > j1.json
- jq '.' ./test/json/lm_75662.localmag.json > j2.json
# Test ew2openapi standalone with TYPE_STRONGMOTIONII input file
- ./ew2openapi TYPE_STRONGMOTIONII ./test/gmew/APRC.HHE.IV.--.001.gmew ./test/json/output_test.json
- jq '.' ./test/json/output_test.json > j1.json
- jq '.' ./test/json/APRC.HHE.IV.--.001.gmew.json > j2.json
# - sed -e 's/"hostname":[[:space:]]*"\([^"]\+\)"/"hostname": "DIFF_IGNORE_HOSTNAME"/' j1.json > jj1.json
# - sed -e 's/"hostname":[[:space:]]*"\([^"]\+\)"/"hostname": "DIFF_IGNORE_HOSTNAME"/' j2.json > jj2.json
- grep -w -v "hostname" j1.json > jj1.json
- grep -w -v "hostname" j2.json > jj2.json
- diff jj1.json jj2.json
......@@ -2,8 +2,17 @@
ew2openapi Release History
#########################
* Release 1.10.0 (2018/06/08)
- Remove dependency from EW_LOG and logit() when run as stand-alone mode. Issue #15 (2018/04/24)
- Handle mutual use of sending messages to Webservice or RabbitMQ. Issue #16 (2018/04/24)
- Start developing error exception for RabbitMQ. Issue #17 (2018/04/24)
- Remove send e-mail from code and parameters. Issue #18 (2018/04/24)
- Several fixes and improvements. (2018/04/24)
- Add TYPE_STRONGMOTIONII JSON conversion. Issue #19 (2018/05/22)
- Upgrade json-c to 0.13.1. Issue #23 (2018/06/08)
* Release 1.9.1 (2018/04/20)
- Add handler for classifyin HTTP CODE and manage errors to retry or not to POST message. Issue #13 (2018/04/20)
- Add handler for classifying HTTP CODE and manage errors to retry or not to POST message. Issue #13 (2018/04/20)
- Add parameter ApiBaseUrl in ew2openapi.d and earthworm_commonvars.d. (2018/04/20)
- Hotfix 1.9.1: Print Api Url with complete route for specific message.
......
# ew2openapi
Earthworm module for transporting Earthworm messages from rings to RabbitMQ exchanges. 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 module for transporting Earthworm messages from rings to:
- ew2openapi Webservice
- RabbitMQ exchanges
- JSON files
## Dependencies
* Earthworm http://earthworm.isti.com/trac/earthworm/
* RabbitMQ C client https://github.com/alanxz/rabbitmq-c
* json-c https://github.com/json-c/json-c
* libcurl https://curl.haxx.se/docs/manpage.html
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.
## Usage
......@@ -39,6 +38,12 @@ cat ./20180205-080122.0009627.arc | ew2openapi TYPE_HYP2000ARC - - > ./20180205-
ew2openapi TYPE_HYP2000ARC ./20180205-080122.0009627.arc - > ./20180205-080122.0009627.json 2> out.log
```
## Dependencies
* Earthworm http://earthworm.isti.com/trac/earthworm/
* RabbitMQ C client https://github.com/alanxz/rabbitmq-c
* json-c https://github.com/json-c/json-c
* libcurl https://curl.haxx.se/docs/manpage.html
## Installation
```
......@@ -105,7 +110,7 @@ Select message types to read.
# Message types usually read from HYPO_RING
GetMsgLogo ${EW_INSTALLATION} MOD_WILDCARD TYPE_HYP2000ARC
GetMsgLogo ${EW_INSTALLATION} MOD_WILDCARD TYPE_MAGNITUDE
# GetMsgLogo ${EW_INSTALLATION} MOD_WILDCARD TYPE_STRONGMOTIONII
GetMsgLogo ${EW_INSTALLATION} MOD_WILDCARD TYPE_STRONGMOTIONII
# Earlybird Message types
# GetMsgLogo ${EW_INSTALLATION} MOD_WILDCARD TYPE_PICKTWC
......@@ -217,9 +222,9 @@ Example of TYPE_PICK_SCNL Earthworm message:
},
"ewMessage":{
"pickId":6303684,
"network":"IV",
"station":"VAGA",
"component":"HHZ",
"network":"IV",
"location":"--",
"firstMotion":"U",
"pickWeight":"2",
......@@ -334,8 +339,8 @@ Example of TYPE_HYP2000ARC Earthworm message:
"phases":[
{
"sta":"ATCC",
"net":"IV",
"comp":"EHZ",
"net":"IV",
"loc":"--",
"Plabel":" ",
"Slabel":" ",
......@@ -382,8 +387,8 @@ Example of TYPE_HYP2000ARC Earthworm message:
...
{
"sta":"COR1",
"net":"IV",
"comp":"EHZ",
"net":"IV",
"loc":"--",
"Plabel":" ",
"Slabel":" ",
......@@ -529,6 +534,55 @@ Example of TYPE_MAGNITUDE Earthworm message:
}
```
#### TYPE_STRONGMOTIONII
Example of TYPE_STRONGMOTIONII Earthworm message:
```
{
"ewLogo": {
"type": "TYPE_STRONGMOTIONII",
"module": "MOD_GMEW",
"installation": "INST_INGV",
"instance": "hew3_mole",
"user": "ew",
"hostname": "hew3.int.ingv.it"
},
"ewMessage": {
"quakeId": 74682,
"station": "APRC",
"component": "HHE",
"network": "IV",
"location": "--",
"qAuthor": "014101073:029111073",
"time": "2018-05-22 08:47:13.446000",
"alternateTime": "1970-01-01 00:00:00.000000",
"alternateCode": 0,
"pga": 0.00269,
"pgaTime": "2018-05-22 08:47:13.446000",
"pgv": 3.2e-05,
"pgvTime": "2018-05-22 08:47:21.046000",
"pgd": 9e-06,
"pgdTime": "2018-05-22 08:47:14.436000",
"RSA": [
{
"value": 0.000724,
"period": 0.3
},
{
"value": 0.000309,
"period": 1
},
{
"value": 4.9e-05,
"period": 3
}
]
}
}
```
## GeoJSON Earthworm message conversion
GeoJSON conversion encapsulate JSON Earthworm message conversion within the field `properties` of a `FeatureCollection`.
......
1.9.1 - 2018-04-20
\ No newline at end of file
1.10.0 - 2018-06-08
\ No newline at end of file
Subproject commit 6bd86d1044f62ad3c06209842eda2caaa6c2214b
Subproject commit 985c46fec39d1d3043f98e8d8cdb9d040131b3bb
......@@ -45,7 +45,7 @@ L = $(EW_HOME)/$(EW_VERSION)/lib
BINARIES = \
$(S)/ew2openapi_curl.o \
$(S)/ew2openapi_sendmail.o \
$(S)/ew2openapi_logit.o \
$(S)/ew2openapi_utils.o \
$(S)/ew2openapi_json.o \
$(S)/ew2openapi_geojson.o \
......@@ -53,6 +53,7 @@ BINARIES = \
$(S)/ew2openapi_quakelink.o \
$(S)/ew2openapi_arc.o \
$(S)/ew2openapi_magnitude.o \
$(S)/ew2openapi_strongmotionII.o \
$(S)/ew2openapi_eq_version_name.o \
$(S)/ew2openapi_error.o \
$(S)/ew2openapi_heartbeat.o \
......@@ -64,7 +65,7 @@ BINARIES = \
HEADERS = $(S)/ew2openapi_version.h \
$(S)/ew2openapi_curl.h \
$(S)/ew2openapi_sendmail.h \
$(S)/ew2openapi_logit.h \
$(S)/ew2openapi_utils.h \
$(S)/ew2openapi_json.h \
$(S)/ew2openapi_geojson.h \
......@@ -72,6 +73,7 @@ HEADERS = $(S)/ew2openapi_version.h \
$(S)/ew2openapi_quakelink.h \
$(S)/ew2openapi_arc.h \
$(S)/ew2openapi_magnitude.h \
$(S)/ew2openapi_strongmotionII.h \
$(S)/ew2openapi_eq_version_name.h \
$(S)/ew2openapi_error.h \
$(S)/ew2openapi_heartbeat.h \
......
# 1999/07/28
# The working copy of earthworm.d should live in your EW_PARAMS directory.
#
# An example copy of earthworm.d resides in the vX.XX/environment
# directory of this Earthworm distribution.
# earthworm.d
# Earthworm administrative setup:
# Installation-specific info on
# shared memory rings
# module ids
# message types
# Please read all comments before making changes to this file.
# The character string <-> numerical value mapping for certain
# module id's and message types are sacred to earthworm.d
# and must not be changed!!!
#--------------------------------------------------------------------------
# Shared Memory Ring Keys
#
# Define unique keys for shared memory regions (transport rings).
# All string/value mappings for shared memory keys may be locally altered.
#
# The maximum length of ring string is 32 characters.
#--------------------------------------------------------------------------
Ring WAVE_RING 1000 # public waveform data
Ring PICK_RING 1005 # public parametric data
Ring HYPO_RING 1015 # public hypocenters etc.
Ring BINDER_RING 1020 # private buffer for binder_ew
Ring EQALARM_EW_RING 1025 # private buffer for eqalam_ew
Ring DRINK_RING 1030 # DST drink messages
Ring AD_RING 1035 # A/D waveform ring
Ring CUBIC_RING 1036 # private buffer for cubic_msg
# Do not put FLAG_RING in starstop*.d This is a hidden ring used for termination flags.
Ring FLAG_RING 2000 # a private ring for Startstop 7.5 and later to use
# for flags. If this doesn't exist, startstop will
# create the ring automatically at key 9999
# If you run multiple startstops, you'll need to change
# all ring keys values here in earthworm.d, including
# this one. Do NOT include this private ring in
# the ring area in startstop*d
Ring NAMED_EVENT_RING 2001 # this is a ring used for the tsunami ATWC programs for
# a named event API (see src/libsrc/util/ew_nevent_message.c)
# this does not need to be declared, but it is if you wish
# to have multiple earthworms running on the same host computer
#--------------------------------------------------------------------------
# Module IDs
#
# Define all module name/module id pairs for this installation
# Except for MOD_WILDCARD, all string/value mappings for module ids
# may be locally altered. The character strings themselves may also
# be changed to be more meaningful for your installation.
#
# 0-255 are the only valid module ids.
#
# The maximum length of the module string is 32 characters.
#
# This list is in alphabetical order but doesn't need to be. Go ahead and
# add new modules and module IDs at the end.
#--------------------------------------------------------------------------
Module MOD_WILDCARD 0 # Sacred wildcard value - DO NOT CHANGE!!!
Module MOD_ADSEND 1
Module MOD_ADSEND_A 2
Module MOD_ADSEND_B 3
Module MOD_ADSEND_C 4
Module MOD_AD_DEMUX_A 5
Module MOD_AD_DEMUX_B 6
Module MOD_AEIC2ARC 7
Module MOD_ALARM 8
Module MOD_ARC2TRIG 9
Module MOD_ARCHMAN 10
Module MOD_BINDER 11
Module MOD_BINDER_EW 12
Module MOD_CARLSTATRIG 13
Module MOD_CARLSUBTRIG 14
Module MOD_COAXTORING_A 15
Module MOD_COAXTORING_B 16
Module MOD_COMPRESS_UA 17
Module MOD_CONFIG_WS 18
Module MOD_CSU_TEST 19
Module MOD_CUBIC_MSG 20
Module MOD_DEBIAS 21
Module MOD_DECIMATE 22
Module MOD_DECOMPRESS_UA 23
Module MOD_DISKMGR 24
Module MOD_ELLIPSE2ARC 25
Module MOD_EMAIL_SENDER 26
Module MOD_EQALARM_EW 27
Module MOD_EQASSEMBLE 28
Module MOD_EQFILTER 29
Module MOD_EQFILTERII 30
Module MOD_EQPRELIM 31
Module MOD_EQPROC 32
Module MOD_EVANSASSOC 33
Module MOD_EVANSTRIG 34
Module MOD_EVT_DISCR 35
Module MOD_EW2FILE 36
Module MOD_EW2LISS 37
Module MOD_EW2RSAM 38
Module MOD_EW2SEISVOLE 39
Module MOD_EW2SSAM 40
Module MOD_EWINTEGRATE 41
Module MOD_EXPORT_ACK 42
Module MOD_EXPORT_GENERIC 43
Module MOD_EXPORT_GEN_ACTV 44
Module MOD_EXPORT_SCN 45
Module MOD_EXPORT_SCNL 46
Module MOD_EXPORT_SCNL_ACK 47
Module MOD_EXPORT_SCN_ACTV 48
Module MOD_EXPORT_SCN_PRI 49
Module MOD_FILE2EW 50
Module MOD_FIR 51
Module MOD_GAPLIST 52
Module MOD_GCF2EW 53
Module MOD_GEQPROC 54
Module MOD_GETDST 55
Module MOD_GETDST2 56
Module MOD_GETTERW 57
Module MOD_GLASS_EW 58
Module MOD_GLOBALPROC 59
Module MOD_GMEW 60
Module MOD_GRF2EW 61
Module MOD_HELI1 62
Module MOD_HELI_EWII 64
Module MOD_ID 65
Module MOD_IMPORT_ACK 66
Module MOD_IMPORT_GENERIC 67
Module MOD_IMPORT_GEN_PASV 68
Module MOD_IMPORT_IDA 69
Module MOD_K2ALL 70
Module MOD_K2EW 71
Module MOD_LATENCY_MON 72
Module MOD_LISS2EW 73
Module MOD_LOCALMAG 74
Module MOD_LPTRIG_A 75
Module MOD_LPTRIG_B 76
Module MOD_MAG2ORA 77
Module MOD_MLSERVER 78
Module MOD_MYMODULE 79
Module MOD_NANO2TRACE 80
Module MOD_NANOBOX 81
Module MOD_NAQS2EW 82
Module MOD_NAQSSERSDPT 83
Module MOD_NAQSSERTG 84
Module MOD_NAQSSOH 85
Module MOD_NMXPTOOL 86
Module MOD_NOMODULE 87
Module MOD_NSMP2EW 88
Module MOD_ORAREPORT 89
Module MOD_ORATRACE_FETCH 90
Module MOD_ORATRACE_MRO 91
Module MOD_ORATRACE_REQ 92
Module MOD_ORA_TRACE_FETCH 93
Module MOD_ORA_TRACE_REQ 94
Module MOD_PAGERFEEDER 95
Module MOD_PICKER_A 96
Module MOD_PICKER_B 97
Module MOD_PICKWASHER 98
Module MOD_PICK_EW 99
Module MOD_PICK_RECORDER 100
Module MOD_PKFILTER 101
Module MOD_PSNADSEND_A 102
Module MOD_Q2EW 103
Module MOD_Q3302EW 104
Module MOD_QDDS_SENDER 105
Module MOD_RAYLOC_EW 106
Module MOD_RAYPICKER 107
Module MOD_RCV_EW 108
Module MOD_RCV_NSN7 109
Module MOD_REBOOT_MSS_EW 110
Module MOD_REDI2EW 111
Module MOD_REFTEK2EW 112
Module MOD_REPORT 113
Module MOD_REPORT_B 114
Module MOD_RINGDUP_GENERIC 115
Module MOD_RINGDUP_SCN 116
Module MOD_RINGTOCOAX 117
Module MOD_RINGTOCOAXII 118
Module MOD_SAMTAC2EW 119
Module MOD_SARAADSEND_A 120
Module MOD_SCN2SCNL 121
Module MOD_SCNL2SCN 122
Module MOD_SCREAM2EW 123
Module MOD_SGRAM 124
Module MOD_SHAKEMAPFEED 125
Module MOD_SLINK2EW 126
Module MOD_SM_EW2ORA 127
Module MOD_SRPAR2EW 128
Module MOD_SRPARXCHEWSEND 129
Module MOD_SRUSB2EW 130
Module MOD_STARTSTOP 131
Module MOD_STATMGR 132
Module MOD_STATRIGFILTER 133
Module MOD_STATUS 134
Module MOD_TANKPLAYER 135
Module MOD_TERRA2EW 136
Module MOD_TRG_ASSOC 137
Module MOD_TRIG2DISK 138
Module MOD_TRIGLIST2ORA 139
Module MOD_VDL_EW 140
Module MOD_WAVESERVER 141
Module MOD_WAVESERVERV 142
Module MOD_WFTIMEFILTER 143
Module MOD_WS2EW_A 144
Module MOD_WSV_TEST 145
Module MOD_RUN_IMP_WWS 146
Module MOD_RUN_WWS 147
Module MOD_CODA_AAV 148
Module MOD_CODA_DUR 149
#--------------------------------------------------------------------------
# Message Types
#
# !!! DO NOT USE message types 0 thru 99 in earthworm.d !!!
#
# Define all message name/message-type pairs for this installation.
#
# VALID numbers are:
#
# 100-255 Message types 100-255 are defined in each installation's
# earthworm.d file, under the control of each Earthworm
# installation. These values should be used to label messages
# which remain internal to an Earthworm system or installation.
# The character strings themselves should not be changed because
# the strings are often hard-coded into the modules.
# However, the string/value mappings can be locally altered.
# Any message types for locally-produced code may be defined here.
#
#
# OFF-LIMITS numbers:
#
# 0- 99 Message types 0-99 are defined in the file earthworm_global.d.
# These numbers are reserved by Earthworm Central to label types
# of messages which may be exchanged between installations. These
# string/value mappings must be global to all Earthworm systems
# in order for exchanged messages to be properly interpreted.
#
# The maximum length of the type string is 32 characters.
#
#--------------------------------------------------------------------------
# Installation-specific message-type mappings (100-255):
Message TYPE_SPECTRA 100
Message TYPE_QUAKE2K 101
Message TYPE_LINK 102
Message TYPE_EVENT2K 103
Message TYPE_PAGE 104
Message TYPE_KILL 105
Message TYPE_DSTDRINK 106
Message TYPE_RESTART 107
Message TYPE_REQSTATUS 108
Message TYPE_STATUS 109
Message TYPE_EQDELETE 110
Message TYPE_EVENT_SCNL 111
Message TYPE_RECONFIG 112
Message TYPE_STOP 113 # stop a child. same as kill, except statmgr
# should not restart it
Message TYPE_CANCELEVENT 114 # used by eqassemble
Message TYPE_CODA_AAV 115
Message TYPE_ACTIVATE_MODULE 117 # used by activated scripts
Message TYPE_ACTIVATE_COMPLETE 118 # used by activated scripts
# !!! DO NOT USE message types 0 thru 99 in earthworm.d !!!
This diff is collapsed.
......@@ -22,22 +22,19 @@
EWInstanceName ${EWMOLE_INSTANCENAME}
# ew2openapi connection parameter
ApiBaseUrl http://jabba.int.ingv.it:10013/ingvws/eventdb
ApiBaseUrl ${EW2OPENAPI_APIBASEURL}
# Rabbit DB connection parameters
RMQHostname ${RABBITMQ_HOSTNAME}
RMQPort ${RABBITMQ_PORT}
RMQExchange ${RABBITMQ_EXCHANGE}
RMQVirtualHost ${RABBITMQ_VIRTUALHOST}
RMQUsername ${RABBITMQUSER}
RMQPassword ${RABBITMQPASS}
# RMQHostname ${RABBITMQ_HOSTNAME}
# RMQPort ${RABBITMQ_PORT}
# RMQExchange ${RABBITMQ_EXCHANGE}
# RMQVirtualHost ${RABBITMQ_VIRTUALHOST}
# RMQUsername ${RABBITMQUSER}
# RMQPassword ${RABBITMQPASS}
# Seconds to wait after a Service Error
WaitSecAfterServiceError 5
# Flag to debug MySql instructions
DebugMySql 0
# Logos of messages to export to client systems
# Each message of a given logo will be written to a file with the specified
# File Suffix at the end of the file name folloing `.'.
......@@ -58,7 +55,7 @@ DebugMySql 0
# Message types usually read from HYPO_RING
GetMsgLogo ${EW_INSTALLATION} MOD_WILDCARD TYPE_HYP2000ARC
GetMsgLogo ${EW_INSTALLATION} MOD_WILDCARD TYPE_MAGNITUDE
# GetMsgLogo ${EW_INSTALLATION} MOD_WILDCARD TYPE_STRONGMOTIONII
GetMsgLogo ${EW_INSTALLATION} MOD_WILDCARD TYPE_STRONGMOTIONII
# Earlybird Message types
# GetMsgLogo ${EW_INSTALLATION} MOD_WILDCARD TYPE_PICKTWC
......@@ -98,33 +95,3 @@ SendMessageFormat JSON
maxsite 3500
site_file all_stations.hinv
# mail commands are optional. ew2openapi is also able to sent messages
# TYPE_PICK_SCNL, TYPE_CODA_SCNL, TYPE_HYP2000ARC and TYPE_MAGNITUDE,
# to the email recipients specified below.
#
# Syntax
# mail <emailAddress1>
# mail <emailAddress2>
# ...
# mail <emailAddressN>
#
# Specify the name of a computer to use as a mail server.
# This system must be alive for mail to be sent out.
# This parameter is used by Windows NT only.
MailServer mail.server.domain
# Specify the "From" line for the email messages. (not required)
# If commented out, the email "From" field will be filled out
# with environment variables: %USERNAME%@%COMPUTERNAME%.
# This parameter is used by Windows NT only.
# mailFrom username@thishost
mailFrom "account@server.domain"
# Mail program to use, e.g /usr/ucb/Mail (not required)
# If given, it must be a full pathname to a mail program
#
# MailProgram /usr/ucb/Mail
# MailProgram "/usr/ucb/Mail -r account@server.domain"
......@@ -45,21 +45,22 @@
#include <amqp_framing.h>
#include "amqp_utils.h"
#include "ew2openapi_logit.h"
void die(const char *fmt, ...)
{
va_list ap;
va_start(ap, fmt);
vfprintf(stderr, fmt, ap);
ew2openapi_logit("et", fmt, ap);
va_end(ap);
fprintf(stderr, "\n");
ew2openapi_logit("e", "\n");
exit(1);
}
void die_on_error(int x, char const *context)
{
if (x < 0) {
fprintf(stderr, "%s: %s\n", context, amqp_error_string2(x));
ew2openapi_logit("et", "%s: %s\n", context, amqp_error_string2(x));
exit(1);
}
}
......@@ -71,11 +72,11 @@ void die_on_amqp_error(amqp_rpc_reply_t x, char const *context)
return;
case AMQP_RESPONSE_NONE:
fprintf(stderr, "%s: missing RPC reply type!\n", context);
ew2openapi_logit("et", "%s: missing RPC reply type!\n", context);
break;
case AMQP_RESPONSE_LIBRARY_EXCEPTION:
fprintf(stderr, "%s: %s\n", context, amqp_error_string2(x.library_error));
ew2openapi_logit("et", "%s: %s\n", context, amqp_error_string2(x.library_error));
break;
case AMQP_RESPONSE_SERVER_EXCEPTION:
......@@ -83,7 +84,7 @@ void die_on_amqp_error(amqp_rpc_reply_t x, char const *context)
case AMQP_CONNECTION_CLOSE_METHOD:
{
amqp_connection_close_t *m = (amqp_connection_close_t *) x.reply.decoded;
fprintf(stderr, "%s: server connection error %d, message: %.*s\n",
ew2openapi_logit("et", "%s: server connection error %d, message: %.*s\n",
context,
m->reply_code,
(int) m->reply_text.len, (char *) m->reply_text.bytes);
......@@ -92,15 +93,15 @@ void die_on_amqp_error(amqp_rpc_reply_t x, char const *context)
case AMQP_CHANNEL_CLOSE_METHOD:
{