[PATCH] [mamda] map a delete msg through mamda as an error callback
Ian Bell <IBell@...>
commit be5ec93af947d5ed9458bf8a5e05b7300a9322d6 Author: Ian Bell <IBell@...> Date: Thu May 17 21:47:41 2012 +0100
[mamda] map a delete msg through mamda as an error callback Signed-off-by: Ian Bell <IBell@...>
diff --git a/mama/c_cpp/src/c/mama/status.h b/mama/c_cpp/src/c/mama/status.h index 1c48c00..ab51f63 100644 --- a/mama/c_cpp/src/c/mama/status.h +++ b/mama/c_cpp/src/c/mama/status.h @@ -94,6 +94,8 @@ typedef enum MAMA_STATUS_INVALID_QUEUE = 27, /* Not modifiable */ MAMA_STATUS_NOT_MODIFIABLE = 28, + /* Message Type DELETE */ + MAMA_STATUS_DELETE = 29, /* Not permissioned for the subject */ MAMA_STATUS_NOT_PERMISSIONED = 4001, /* Subscription is in an invalid state. */ diff --git a/mama/c_cpp/src/c/status.c b/mama/c_cpp/src/c/status.c index e8c1c31..f5cb3ff 100644 --- a/mama/c_cpp/src/c/status.c +++ b/mama/c_cpp/src/c/status.c @@ -57,6 +57,7 @@ mamaStatus_stringForStatus (mama_status status) case MAMA_STATUS_NOT_INSTALLED : return "NOT_INSTALLED"; case MAMA_STATUS_NO_BRIDGE_IMPL : return "NO_BRIDGE_IMPL"; case MAMA_STATUS_INVALID_QUEUE : return "INVALID_QUEUE"; + case MAMA_STATUS_DELETE : return "STATUS_DELETE"; case MAMA_STATUS_NOT_MODIFIABLE : return "NOT_MODIFIABLE"; case MAMA_STATUS_NOT_PERMISSIONED : return "MAMA_STATUS_NOT_PERMISSIONED"; case MAMA_STATUS_SUBSCRIPTION_INVALID_STATE: return "MAMA_STATUS_SUBSCRIPTION_INVALID_STATE"; diff --git a/mama/jni/src/com/wombat/mama/MamaMsgStatus.java b/mama/jni/src/com/wombat/mama/MamaMsgStatus.java index 52060d9..65da8d9 100644 --- a/mama/jni/src/com/wombat/mama/MamaMsgStatus.java +++ b/mama/jni/src/com/wombat/mama/MamaMsgStatus.java @@ -81,6 +81,10 @@ public class MamaMsgStatus /** Message with duplicate sequence number */ public static final short STATUS_DUPLICATE = 15; + /** Message with the type of DELETE */ + public static final short STATUS_DELETE = 17; + + public static final short STATUS_EXCEPTION = 999; /** diff --git a/mamda/c_cpp/src/cpp/MamdaSubscription.cpp b/mamda/c_cpp/src/cpp/MamdaSubscription.cpp index 9b6599c..d9a9d30 100644 --- a/mamda/c_cpp/src/cpp/MamdaSubscription.cpp +++ b/mamda/c_cpp/src/cpp/MamdaSubscription.cpp @@ -471,6 +471,21 @@ namespace Wombat switch (msgType) { case MAMA_MSG_TYPE_DELETE: + if (subscription->checkDebugLevel (MAMA_LOG_LEVEL_FINE)) + { + const char *contentSymbol = "N/A"; + msg.tryString (MamdaCommonFields::ISSUE_SYMBOL, contentSymbol); + + mama_forceLog (MAMA_LOG_LEVEL_FINE, + "MamdaSubscription (%s.%s(%s)) " + "ignoring msg. type: %s\n", + mSource->getPublisherSourceName(), + mSymbol.c_str (), + contentSymbol, + msg.getMsgTypeName()); + } + onError (subscription, MAMA_STATUS_DELETE , "Msg Type Delete"); + return; case MAMA_MSG_TYPE_EXPIRE: if (subscription->checkDebugLevel (MAMA_LOG_LEVEL_FINE)) { @@ -566,6 +581,11 @@ namespace Wombat code = MAMDA_ERROR_BAD_SYMBOL; errStr = "bad symbol"; break; + case MAMA_STATUS_DELETE: + severity = MAMDA_SEVERITY_OK; + code = MAMDA_ERROR_DELETE; + errStr = "message type delete"; + break; case MAMA_STATUS_TIMEOUT: severity = MAMDA_SEVERITY_HIGH; code = MAMDA_ERROR_TIME_OUT; diff --git a/mamda/c_cpp/src/cpp/mamda/MamdaErrorListener.h b/mamda/c_cpp/src/cpp/mamda/MamdaErrorListener.h index d93877f..5168987 100644 --- a/mamda/c_cpp/src/cpp/mamda/MamdaErrorListener.h +++ b/mamda/c_cpp/src/cpp/mamda/MamdaErrorListener.h @@ -57,7 +57,7 @@ namespace Wombat MAMDA_ERROR_TIME_OUT, MAMDA_ERROR_ENTITLEMENT, MAMDA_ERROR_NOT_FOUND, - MAMDA_ERROR_WATCH_THIS_SPACE + MAMDA_ERROR_DELETE }; /** diff --git a/mamda/java/com/wombat/mamda/MamdaErrorCode.java b/mamda/java/com/wombat/mamda/MamdaErrorCode.java index fa25213..59de128 100644 --- a/mamda/java/com/wombat/mamda/MamdaErrorCode.java +++ b/mamda/java/com/wombat/mamda/MamdaErrorCode.java @@ -72,6 +72,9 @@ public class MamdaErrorCode /** Bandwidth exceeded */ public static final short MAMDA_ERROR_BANDWIDTH_EXCEEDED = 14; + /** Message of type DELETE */ + public static final short MAMDA_ERROR_DELETE = 17; + public static final short MAMDA_ERROR_EXCEPTION = 999;
@@ -100,6 +103,7 @@ public class MamdaErrorCode case MAMDA_ERROR_TOPIC_CHANGE: return "TOPIC_CHANGE"; case MAMDA_ERROR_BANDWIDTH_EXCEEDED: return "BANDWIDTH_EXCEEDED"; case MAMDA_ERROR_EXCEPTION: return "EXCEPTION PROCESSING MESSAGE"; + case MAMDA_ERROR_DELETE: return "MESSAGE TYPE DELETE"; default: return "UNKNOWN"; } } @@ -124,6 +128,7 @@ public class MamdaErrorCode case MamaMsgStatus.STATUS_TOPIC_CHANGE: return MAMDA_ERROR_TOPIC_CHANGE; case MamaMsgStatus.STATUS_BANDWIDTH_EXCEEDED: return MAMDA_ERROR_BANDWIDTH_EXCEEDED; case MamaMsgStatus.STATUS_EXCEPTION: return MAMDA_ERROR_EXCEPTION; + case MamaMsgStatus.STATUS_DELETE: return MAMDA_ERROR_DELETE; } return -1; diff --git a/mamda/java/com/wombat/mamda/MamdaSubscription.java b/mamda/java/com/wombat/mamda/MamdaSubscription.java index 3d82225..46efd13 100644 --- a/mamda/java/com/wombat/mamda/MamdaSubscription.java +++ b/mamda/java/com/wombat/mamda/MamdaSubscription.java @@ -470,10 +470,15 @@ public class MamdaSubscription short msgType = MamaMsgType.typeForMsg (msg); int msgStatus = MamaMsgStatus.statusForMsg (msg); mLatestMsg = msg; + short mywombatStatus = 17; + int myplatformError = 0; + Exception myException = new Exception(); switch (msgType) { case MamaMsgType.TYPE_DELETE: + onError (subscription, mywombatStatus, myplatformError, "Message Type Delete", myException); + return; case MamaMsgType.TYPE_EXPIRE: subscription.destroy(); mLatestMsg = null; Please consider the environment before printing this e-mail. This e-mail may contain confidential and/or privileged information. If you are not the intended recipient or have received this e-mail in error, please advise the sender immediately by reply e-mail and delete this message and any attachments without retaining a copy. Any unauthorised copying, disclosure or distribution of the material in this e-mail is strictly forbidden.
|
|
[PATCH] [mamda] Fixed an issue where the delta list was not cleared on a book clear
Ian Bell <IBell@...>
commit 68b1fc12fde4b6edde78cb3a0fde6b542f8b9053 Author: Ian Bell <IBell@...> Date: Thu May 17 21:52:02 2012 +0100
[mamda] Fixed an issue where the delta list was not cleared on a book clear Signed-off-by: Ian Bell <IBell@...>
diff --git a/mamda/c_cpp/src/cpp/orderbooks/MamdaOrderBook.cpp b/mamda/c_cpp/src/cpp/orderbooks/MamdaOrderBook.cpp index 440db8f..0c71c30 100644 --- a/mamda/c_cpp/src/cpp/orderbooks/MamdaOrderBook.cpp +++ b/mamda/c_cpp/src/cpp/orderbooks/MamdaOrderBook.cpp @@ -428,6 +428,11 @@ namespace Wombat mImpl.mNeedsReevaluation = false; // do not reset mImpl.mCheckVisibility + + if (mImpl.mGenerateDeltas) + { + clearDeltaList(); + } } void MamdaOrderBook::setSymbol (const char* symbol) Please consider the environment before printing this e-mail. This e-mail may contain confidential and/or privileged information. If you are not the intended recipient or have received this e-mail in error, please advise the sender immediately by reply e-mail and delete this message and any attachments without retaining a copy. Any unauthorised copying, disclosure or distribution of the material in this e-mail is strictly forbidden.
|
|
[PATCH] [MAMDA] JDK-1.7
Ian Bell <IBell@...>
commit 0747f4e1576b405113af509368b50f3dd2e2f0d8 Author: Ian Bell <IBell@...> Date: Thu May 17 21:49:45 2012 +0100
[mamda] Fixed build for Java 1.7 Signed-off-by: Ian Bell <IBell@...>
diff --git a/mamda/java/build.xml b/mamda/java/build.xml index 395fad4..7300e68 100644 --- a/mamda/java/build.xml +++ b/mamda/java/build.xml @@ -11,6 +11,7 @@ <echo message="ant.java.version=${ant.java.version}"></echo> <condition property="isJava5or6"> <or> + <equals arg1="${ant.java.version}" arg2="1.7"></equals> <equals arg1="${ant.java.version}" arg2="1.6"></equals> <equals arg1="${ant.java.version}" arg2="1.5"></equals> </or> Please consider the environment before printing this e-mail. This e-mail may contain confidential and/or privileged information. If you are not the intended recipient or have received this e-mail in error, please advise the sender immediately by reply e-mail and delete this message and any attachments without retaining a copy. Any unauthorised copying, disclosure or distribution of the material in this e-mail is strictly forbidden.
|
|
Upcoming Patches
Ian Bell <IBell@...>
Hi
The following patches are a result of ongoing maintenance of the commercial version of MAMA.
Patches will be submitted every 2-3 weeks to this list for review and application to OpenMAMA. As this is the first set there are a few more than will usually be the case.
Ian Bell Senior Software Engineer NYSE Technologies Please consider the environment before printing this e-mail. This e-mail may contain confidential and/or privileged information. If you are not the intended recipient or have received this e-mail in error, please advise the sender immediately by reply e-mail and delete this message and any attachments without retaining a copy. Any unauthorised copying, disclosure or distribution of the material in this e-mail is strictly forbidden.
|
|
[PATCH] [README] Updated Build Instructions
Michael Schonberg <mschonberg@...>
From: Mike Schonberg <mschonberg@nyx.com>
Added better download and build instructions for the Avis client and router. For the OpenMAMA build it is necessary to specify --with-avis to build the Avis bridge, and it is also necessary to invoke generateBuildFiles.sh prior to building source from a cloned git repository. Signed-off-by: Mike Schonberg <mschonberg@nyx.com> --- README | 25 ++++++++++++++++++++++--- 1 files changed, 22 insertions(+), 3 deletions(-) diff --git a/README b/README index 855bb3a..0132ec4 100644 --- a/README +++ b/README @@ -56,7 +56,7 @@ To use OpenMAMA you will need a middleware/payload. An example middleware bridge and payload is included for Avis. Avis can be obtained from the following website: -http://avis.sourceforge.net. + http://avis.sourceforge.net. OpenMAMA API reference documentation depends on: @@ -267,11 +267,22 @@ Currently OpenMAMA assumes Avis is the middleware to be built with, as this is currently the only opensource middleware supported. Therefore, the Avis client libraries must be available. +The Avis router (avisd) is avalaible from: + http://sourceforge.net/projects/avis/viles/Avis%20router/ + +To build the avis client: + download the source from: + http://downloads.sourceforge.net/avis/avis-client-1.2.4.tar.gz + tar -xzf avis-client-1.2.4.tar.gz + cd avis-client-1.2.4 + ./configure --prefix=${AVIS_HOME} + make install + The default install of Avis is missing a header file. This needs to be moved manually in the include directory. The OpenMAMA configure script checks for this header and will exit with an error if not found. - mv ${AVIS_SOURCE}/lib/avis_client_config.h ${AVIS_HOME}/include/avis + mv ${AVIS_SOURCE}/platforms/gnu_automake/avis_client_config.h ${AVIS_HOME}/include/avis @@ -291,7 +302,15 @@ The following uses the default settings to build the OpenMAMA library and example applications. This assumes that Avis middleware is available in /usr/local, and will install OpenMAMA to /opt/OpenMAMA - ./configure +If you are building source code cloned from the OpenMAMA git repository run the +following command before following the remaining instructions: + + ./generateBuildFiles.sh + +For source downloaded as an archive from http://www.openmama.org, it is not +necessary to run generateBuildFiles.sh. + + ./configure --with-avis=/usr/local make sudo make install -- 1.7.7.6
|
|
Re: OpenMAMA bridge implementation
Les Spiro
And here are the PDF's that Pavel meant to attach :)
Not sure if they will be forwarded via the mailing list. It's an interesting experience for us as we start to port our drivers (which look more like Reuters SSL) into OpenMama bridges which look more like Tib RV :) For example is it interesting to see the way the subscription call looks like create a subscription message, then code to set various values followed by a send message (although also interesting to see the cheat in the Avis driver which just makes the subscribe call on the create subscription message). Anyway we will be producing a few of these bridges (announcements when they are ready for beta testing) and so we are interested in any feedback/advice. Les Spiro http://www.tick42.com http://twitter.com/intent/user?screen_name=Tick_42 On 16/05/2012 17:02, "Pavel Patarinski" <pavel.patarinski@tick42.com> wrote: Hi all,
|
|
OpenMAMA bridge implementation
Pavel Patarinski <pavel.patarinski@...>
Hi all,
At Tick42 we are porting various data feed drivers (rather than middleware connectors) to load as OpenMama bridges, I have been making some notes on the various calls into the Bridge API to help me work out what order things are called in. I have produced the following three documents which show the sequence of calls into the Avis Bridge when running an OpenMama subscriber. I am using these to help work out where to put various chunks of our existing driver code. Given the work that people are starting to do on producing drivers, we thought it might be useful to share these notes. Please feed back with any comments or corrections. 1. Initialization and startup: The first document describes order of execution and some basic description of bridge interface functions which are called during OpenMAMA initialization and startup. 2. Making a subscription: The second document lists bridge interface functions which are used when subscription is created. 3. Decoding the data: The third document describes how payload message is created and processed by OpenMAMA framework. Pavel Pararinski www.tick42.com
|
|
Re: README out of date to perform build on Linux
Mike Schonberg <mschonberg@...>
On Sat, 12 May 2012, David Ashburner wrote:
Hi Guys,I will update this. It might make sense to point to http://downloads.sourceforge.net/avis/ so it is less likely to get out of date with new Avis release. 2. avis ./configure, buildI will make the appropriate changes as well. 4. run script to generate configure scrpts in downstream directoriesSomeone else pointed out the same problem in bugzilla. I am preparing a patch that updates the readme to inlcude this step for git builds. Currently the source tarball does not contain the configure scripts. I will remedy this shortly as well. The next REAME patch will contain this as well. 6. make, make installFrom the top directory, "make install" should install the compiled examples in <prefix>/bin and the example source in <prefix>/examples/... Are you running make with more than one job (-j > 2)? Thanks for the detailed feedback. This is very helpful. The build process is not nearly as smooth as I would like it. I will incorporate your suggestions in one more patches Regards, -Mike Please consider the environment before printing this email. Visit our website at http://www.nyse.com **************************************************** Note: The information contained in this message and any attachment to it is privileged, confidential and protected from disclosure. If the reader of this message is not the intended recipient, or an employee or agent responsible for delivering this message to the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please notify the sender immediately by replying to the message, and please delete it from your system. Thank you. NYSE Euronext.
|
|
README out of date to perform build on Linux
David @ Rai Technology
Hi Guys,
Just gone through install and build and found a few things out of date in the README. The main one is the need to run the obviously named generateBuildFiles.sh building source from git ================ Instructions in README seem to be out of date or need a little more detailed. 1. instal avis client from here: http://downloads.sourceforge.net/avis/avis-client-1.2.4.tar.gz 2. avis ./configure, build 3. tweak avis, copy missing header file from correct platform location export AVIS_HOME=<where you installed it> cp ${AVIS_HOME}/platforms/gnu_automake/avis_client_config.h ${AVIS_HOME}/src/include/avis 4. run script to generate configure scrpts in downstream directories ./generateBuildFiles.sh 5. ./configure --prefix=/home/openmama --avis-path=${AVIS_HOME}/src/avis-client-1.2.4/src 6. make, make install couple of things I haven't fully tracked down yet: make install in the top dir does not install the mama/examples when you run make install in the example/c dir it installs in /bin not examples/mama as the mamda and jni examples do Regards, David
|
|
Re: OpenMAMA 2.1 - configure: WARNING: unrecognized options: --with-avis
David @ Rai Technology
Hi Mark, You are using the wrong option it should be ./configure --avis-path=<avis source dir> inside configure this argument gets converted to the --with-avis required by the other configure scripts Regards, David ---snip---x case $i in --avis-path=*) AVIS_HOME=${i#*=} WITH_AVIS="--with-avis=${AVIS_HOME}" ;; ----snip--x
|
|
Re: FYI erroneous log messages
Mike Schonberg <mschonberg@...>
William,
Thanks for pointing that out. I just submitted a patch that fixes that and cleans up some of the coding style in that file as well.
Regards, -Mike
From: openmama-dev-bounces@... [mailto:openmama-dev-bounces@...] On Behalf Of William Henry
Sent: Thursday, May 10, 2012 5:01 PM To: openmama-dev@... Subject: [Openmama-dev] FYI erroneous log messages
Hi, Please consider the environment before printing this email. Visit our website at http://www.nyse.com
|
|
[PATCH] [avis-bridge] Fix code style and incorrect logging
Michael Schonberg <mschonberg@...>
From: Mike Schonberg <mschonberg@nyx.com>
Two log statements in avisBridgeMamaTransport_destroy() incorrectly logged "create". Cleaned up most of the file to adhere more closely to the dominant coding convention. Wide lines reduced to 80 columns and C++ style single line comments converted to C comments. Moved {'s to their own lines for conditionals. Signed-off-by: Mike Schonberg <mschonberg@nyx.com> --- mama/c_cpp/src/c/bridge/avis/transportbridge.c | 138 ++++++++++++++++-------- 1 files changed, 94 insertions(+), 44 deletions(-) diff --git a/mama/c_cpp/src/c/bridge/avis/transportbridge.c b/mama/c_cpp/src/c/bridge/avis/transportbridge.c index de10b61..5b8d32d 100755 --- a/mama/c_cpp/src/c/bridge/avis/transportbridge.c +++ b/mama/c_cpp/src/c/bridge/avis/transportbridge.c @@ -40,10 +40,10 @@ #define avisTransport(transport) ((avisTransportBridge*) transport) #define CHECK_TRANSPORT(transport) \ - do { \ - if (avisTransport(transport) == 0) return MAMA_STATUS_NULL_ARG; \ - if (avisTransport(transport)->mAvis == 0) return MAMA_STATUS_INVALID_ARG; \ - } while(0) + do { \ + if (avisTransport(transport) == 0) return MAMA_STATUS_NULL_ARG; \ + if (avisTransport(transport)->mAvis == 0) return MAMA_STATUS_INVALID_ARG;\ + } while(0) @@ -55,26 +55,45 @@ void* avisDispatchThread(void* closure); void log_avis_error(MamaLogLevel logLevel, Elvin* avis) { - mama_log (logLevel, "avis error code=%d, error msg=%s", avis->error.code, avis->error.message); + mama_log (logLevel, "avis error code=%d, error msg=%s", avis->error.code, + avis->error.message); } -void closeListener(Elvin* avis, CloseReason reason, const char* message, void* closure) +void closeListener(Elvin* avis, + CloseReason reason, + const char* message, + void* closure) { const char* errMsg; - if (avisBridge(closure) == NULL) { - mama_log (MAMA_LOG_LEVEL_FINE, "Avis closeListener: could not get Avis bridge"); + if (avisBridge(closure) == NULL) + { + mama_log (MAMA_LOG_LEVEL_FINE, + "Avis closeListener: could not get Avis bridge"); return; } switch( reason ) { - case REASON_CLIENT_SHUTDOWN: errMsg = "Avis client shutdown"; break; - case REASON_ROUTER_SHUTDOWN: errMsg = "Avis router shutdown"; break; - case REASON_PROTOCOL_VIOLATION: errMsg = "Avis protocol violation"; break; - case REASON_ROUTER_STOPPED_RESPONDING: errMsg = "Avis router stopped responding"; break; - default: errMsg = "Unknown Avis error"; + case REASON_CLIENT_SHUTDOWN: + errMsg = "Avis client shutdown"; + break; + case REASON_ROUTER_SHUTDOWN: + errMsg = "Avis router shutdown"; + break; + case REASON_PROTOCOL_VIOLATION: + errMsg = "Avis protocol violation"; + break; + case REASON_ROUTER_STOPPED_RESPONDING: + errMsg = "Avis router stopped responding"; + break; + default: + errMsg = "Unknown Avis error"; } - mamaTransportImpl_disconnect(avisBridge(closure)->mTransportBridge->mTransport, MAMA_TRANSPORT_DISCONNECT, NULL, NULL); + mamaTransportImpl_disconnect( + avisBridge(closure)->mTransportBridge->mTransport, + MAMA_TRANSPORT_DISCONNECT, + NULL, + NULL); mama_log (MAMA_LOG_LEVEL_FINE, "%s : %s", errMsg, message); } @@ -98,7 +117,7 @@ getURL( const char *name ) return DEFAULT_URL; mama_log (MAMA_LOG_LEVEL_FINER, - "Avis transport (%s) main connection: %s", name, property); + "Avis transport (%s) main connection: %s", name, property); return property; } @@ -106,7 +125,10 @@ getURL( const char *name ) Elvin* getAvis(mamaTransport transport) { avisTransportBridge* pTransportBridge; - mama_status status = mamaTransport_getBridgeTransport (transport, (void*) &pTransportBridge); + mama_status status; + + status = mamaTransport_getBridgeTransport (transport, + (void*) &pTransportBridge); if ((status != MAMA_STATUS_OK) || (pTransportBridge == NULL)) return NULL; @@ -125,12 +147,14 @@ void* avisDispatchThread(void* closure) mama_status avisTransportBridge_start(avisTransportBridge* transportBridge) { - // stop Avis event loop + /* stop Avis event loop */ wthread_t tid; int rc; CHECK_TRANSPORT(transportBridge); - if (0 != (rc = wthread_create(&tid, NULL, avisDispatchThread, transportBridge))) { + rc = wthread_create(&tid, NULL, avisDispatchThread, transportBridge); + if (0 != rc) + { mama_log (MAMA_LOG_LEVEL_ERROR, "wthread_create returned %d", rc); return MAMA_STATUS_SYSTEM_ERROR; } @@ -144,13 +168,16 @@ mama_status avisTransportBridge_stop(avisTransportBridge* transportBridge) { CHECK_TRANSPORT(transportBridge); - // stop Avis event loop + /* stop Avis event loop */ elvin_remove_close_listener(transportBridge->mAvis, closeListener); - if (!elvin_invoke_close(transportBridge->mAvis)) { - // there appears to be a race condition in Avis libs where router socket can sometimes be closed before - // we receive the disconnect reply -- log it, and continue + if (!elvin_invoke_close(transportBridge->mAvis)) + { + /* there appears to be a race condition in Avis libs where router socket + * can sometimes be closed before we receive the disconnect reply -- log + * it, and continue */ log_avis_error(MAMA_LOG_LEVEL_FINE, transportBridge->mAvis); } + while (-1 == wsem_wait(&transportBridge->mAvisDispatchSem)) { if (errno != EINTR) return MAMA_STATUS_SYSTEM_ERROR; @@ -192,8 +219,8 @@ avisBridgeMamaTransport_getLoadBalanceScheme ( mama_status avisBridgeMamaTransport_create (transportBridge* result, - const char* name, - mamaTransport mamaTport ) + const char* name, + mamaTransport mamaTport ) { mama_status status; avisBridgeImpl* avisBridge = NULL; @@ -201,45 +228,60 @@ avisBridgeMamaTransport_create (transportBridge* result, mamaBridgeImpl* bridgeImpl = NULL; const char* url = NULL; - transport = (avisTransportBridge*)calloc( 1, sizeof( avisTransportBridge ) ); + transport = (avisTransportBridge*)calloc( 1, sizeof( avisTransportBridge )); if (transport == NULL) return MAMA_STATUS_NOMEM; transport->mTransport = (mamaTransport) mamaTport; bridgeImpl = mamaTransportImpl_getBridgeImpl(mamaTport); - if (!bridgeImpl) { - mama_log (MAMA_LOG_LEVEL_ERROR, "avisBridgeMamaTransport_create(): Could not get bridge"); + if (!bridgeImpl) + { + mama_log (MAMA_LOG_LEVEL_ERROR, + "avisBridgeMamaTransport_create(): Could not get bridge"); free(transport); return MAMA_STATUS_PLATFORM; } - if (MAMA_STATUS_OK != (status = mamaBridgeImpl_getClosure((mamaBridge) bridgeImpl, (void**) &avisBridge))) { - mama_log (MAMA_LOG_LEVEL_ERROR, "avisBridgeMamaTransport_create(): Could not get Avis bridge object"); + + status = mamaBridgeImpl_getClosure((mamaBridge) bridgeImpl, + (void**) &avisBridge); + if (MAMA_STATUS_OK != status) + { + mama_log (MAMA_LOG_LEVEL_ERROR, + "avisBridgeMamaTransport_create(): Could not get Avis bridge object"); free(transport); return status; } - if (avisBridge->mTransportBridge != NULL) { - mama_log (MAMA_LOG_LEVEL_ERROR, "avisBridgeMamaTransport_create(): Avis already connected"); + if (avisBridge->mTransportBridge != NULL) + { + mama_log (MAMA_LOG_LEVEL_ERROR, + "avisBridgeMamaTransport_create(): Avis already connected"); free(transport); return MAMA_STATUS_PLATFORM; } - // create the Elvin object + /* create the Elvin object */ transport->mAvis = (Elvin*)calloc (1, sizeof (Elvin)); - if (transport->mAvis == NULL) { - mama_log (MAMA_LOG_LEVEL_ERROR, "avisBridge_createImpl(): Could not create Elvin object"); + if (transport->mAvis == NULL) + { + mama_log (MAMA_LOG_LEVEL_ERROR, + "avisBridge_createImpl(): Could not create Elvin object"); free(transport); return MAMA_STATUS_PLATFORM; } - // open the server connection + /* open the server connection */ url = getURL(name); - if (url == NULL) { - mama_log (MAMA_LOG_LEVEL_NORMAL, "No %s property defined for transport : %s", TPORT_PARAM, name); + if (url == NULL) + { + mama_log (MAMA_LOG_LEVEL_NORMAL, + "No %s property defined for transport : %s", TPORT_PARAM, name); return MAMA_STATUS_INVALID_ARG; } - if (!elvin_open(transport->mAvis, url)) { - mama_log (MAMA_LOG_LEVEL_ERROR, "open failed for %s: %s", TPORT_PARAM, name); + if (!elvin_open(transport->mAvis, url)) + { + mama_log (MAMA_LOG_LEVEL_ERROR, + "open failed for %s: %s", TPORT_PARAM, name); log_avis_error(MAMA_LOG_LEVEL_ERROR, transport->mAvis); avisBridgeMamaTransport_destroy((transportBridge)transport); return MAMA_STATUS_PLATFORM; @@ -262,14 +304,22 @@ avisBridgeMamaTransport_destroy (transportBridge transport) mamaBridgeImpl* bridgeImpl = NULL; - bridgeImpl = mamaTransportImpl_getBridgeImpl(avisTransport(transport)->mTransport); - if (!bridgeImpl) { - mama_log (MAMA_LOG_LEVEL_ERROR, "avisBridgeMamaTransport_create(): Could not get bridge"); + bridgeImpl = mamaTransportImpl_getBridgeImpl( + avisTransport(transport)->mTransport); + if (!bridgeImpl) + { + mama_log (MAMA_LOG_LEVEL_ERROR, + "avisBridgeMamaTransport_destroy(): Could not get bridge"); free(transport); return MAMA_STATUS_PLATFORM; } - if (MAMA_STATUS_OK != (status = mamaBridgeImpl_getClosure((mamaBridge) bridgeImpl, (void**) &avisBridge))) { - mama_log (MAMA_LOG_LEVEL_ERROR, "avisBridgeMamaTransport_create(): Could not get Avis bridge object"); + + status = mamaBridgeImpl_getClosure((mamaBridge) bridgeImpl, + (void**) &avisBridge); + if (MAMA_STATUS_OK != status) + { + mama_log (MAMA_LOG_LEVEL_ERROR, + "avisBridgeMamaTransport_destroy(): Could not get Avis bridge object"); free(transport); return status; } -- 1.7.7.6
|
|
FYI erroneous log messages
William Henry <whenry@...>
Hi, Got some time today to look through the avis bridge code to try and understand the flow more. Not a biggie: I found that avisBridgeMamaTransport_destroy() logs two avisBridgeMamaTransport_create traces. William
|
|
Re: General MAMA feature / project questions
Mike Schonberg <mschonberg@...>
On Wed, 9 May 2012, Noah Zucker wrote:
Greetings all. I'm getting started with OpenMAMA here at NYSE and had themama_open() by default attempts to load properties from $WOMBAT_PATH/mama.properties. mama_openWithProperties(path, filename) initializes OpenMAMA reading the properties from path/filename rather than $WOMBAT_PATH/mama.properties. mama_getProperty(const char* name) returns the property value given the property name. mama_setProperty(...) alows applications to set/modify properties prgramatically. mama_setPropertiesFromFile(path, filename) loads additional properties from the specfied file. common/c_cpp/src/c/property.h defines the low level interface for manipulating property files. It uses the flex grammar defined in common/.../c/properties.l to parse properties files. Bridges should use mama_getProperty() to access properties. Bridges should prefix all properties with "mama.<bridge_name>". The canonical form is "mama.<bridge_name>.<category>.[<name>].property". The optional name allows for multiple "named" configurations. For example, mama.some_middleware.transport.my_transport.broker_address=127.0.0.1 defines the broker address for a transported named "my_transport" on some_middleware. 1c) Do I have to parse the strings myself, or can I provide just theThe properties parser only knows how to parse the file into name value pairs so bridges need to interpret the resulting value strings. There are a few helper functions like strtobool() in common/.../c/wombat/strutils.h; however it might be nice to start building a well defined library of property parsers/validators standard types (IP addresses, integers, comma delimited lists, etc.). 1d) How / where do I define the configuration parameters that are settable inI suggest that you create properties.h file for your bridge with macros for all your properties and a properties.c file with functions to read and interpret them. Currently the Avis message payload is the only open source payload. Since payloads are not dependent on middleware, it should be possible to use the Avis payload with other middleware bridges. We are currently investigating other potential FOSS payload implementations. One interesting possibility is Google Protocol Buffers. MAMA currently contains default implementations for queues and timers. I would like to see a default implemenatation for IO Events as well. Since most applications do not use IO Events, implementing them is optional. "make clean" should get rid of most of them. I also find "git clean -d -f" useful (WARNING: THIS WILL DELETE ALL UNTRACKED FILES SO MAKE SURE THAT YOU HAVE STASHED, OR ADDED ALL NEW SOURCE FILES FIRST). We should also get out of tree builds working as this minimizing the noise in the source directory. Configure.ac takes care of this. In general you run "configure --with-<middlware_name>" to indicate which bridge(s) you want to build. In the future, I would like to add an option that builds all middlewares for which configure can locate valid libraries. You can configure with --without-middleware-bridge and no bridge will be built. Likewise you can specify --without-payload-bridge to build without a payload bridge. Regards, -Mike Please consider the environment before printing this email. Visit our website at http://www.nyse.com **************************************************** Note: The information contained in this message and any attachment to it is privileged, confidential and protected from disclosure. If the reader of this message is not the intended recipient, or an employee or agent responsible for delivering this message to the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please notify the sender immediately by replying to the message, and please delete it from your system. Thank you. NYSE Euronext.
|
|
General MAMA feature / project questions
Noah Zucker <NZucker@...>
Greetings all. I'm getting started with OpenMAMA here at NYSE and had the below questions. Mike suggested that I send them to this list for the benefit of anyone else who had similar questions:
1) mama.properties 1a) What component / function provides the parsed values from mama.properties? 1b) How does my bridge access configuration in mama.properties? 1c) Do I have to parse the strings myself, or can I provide just the components I need such as the final token that identifies the actual setting I need? 1d) How / where do I define the configuration parameters that are settable in mama.properties? 2) Message Format / Encoding 2a) Does OpenMAMA come with an out-of-the-box encoding for message payload, or is this supposed to be provided by the bridge? 2b) If it comes with payload encoding(s), what are the format(s)? 3) MAMA engine 3a) Does OpenMAMA come with the messaging engine that manages the event loop, queues, queue monitoring, quality of service detection, etc. or does that all (or some of it) have to be provided by the bridge implementation? 4) Build 4a) How do I clean the build? I noticed that there are object files all over the place next to my source files. How do I get rid of these? (Perhaps this is a n00bish question since I'm new to automake). 4b) Have we considered separating bridges from the OpenMAMA project? Related: how do we configure OpenMAMA to build with multiple bridges, or one bridge but not another? Regards, Noah Zucker NYSE Technologies Please consider the environment before printing this email. Visit our website at http://www.nyse.com **************************************************** Note: The information contained in this message and any attachment to it is privileged, confidential and protected from disclosure. If the reader of this message is not the intended recipient, or an employee or agent responsible for delivering this message to the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please notify the sender immediately by replying to the message, and please delete it from your system. Thank you. NYSE Euronext.
|
|
Re: Why are bridges in the general build
Pavel Patarinski
I can build all of the projects under OpenMAMA 2.1 solution (Windows
7, VS 2010).
toggle quoted messageShow quoted text
Requirements: 1. flex - http://gnuwin32.sourceforge.net/packages/flex.htm 2. avis-client - http://avis.sourceforge.net/downloads.html Environment variables: 1. add AVIS_HOME variable with path to avis-client as value. 2. append path to flex executable to system "Path" variable Fix paths in solution: 1. for all of the projects which depends on avis-client lib, remove Debug after AVIS_HOME. Regards Pavel
On 5.05.2012 21:05, Leslie Spiro wrote:
|
|
Why are bridges in the general build
Leslie Spiro <lspiro@...>
Reading the difficulties that William is having getting the Avis bridge to build, wouldn't it make sense to split the build into open mama core (possibly including a null bridge as an example for bridge and payload writers), and then have separate bridge builds ? Also as the number of bridges increase we don't want to keep changing the build as each new bridge is released. Les Spiro Tick42
|
|
Re: Why are bridges in the general build
Michael Schonberg
On Sat, May 5, 2012 at 11:05 AM, Leslie Spiro <lspiro@dotrtt.com> wrote:
Les, You can configure with --without-middleware-bridge and no bridge will be built. Likewise you can specify --without-payload-bridge to build without a payload bridge. I definitely like the idea of a NULL bridge for testing and as a documented template for writing new bridges. I am not sure that separate bridge builds make sense. When I download source, I expect to run configure, make, make install and build something useful. I prefer to make the configure scripts smart enough to build build painlessly. One option is for the default behavior to automatically build bridges if all the required packages (middleware, tools, etc.) are found in the default locations. Updating configure.ac can be painful, but you usually only have to do it once. Currently, I think we need to make the avis configuration more sophisticated. Regards, -Mike Also as the number of bridges increase we don't want to keep changing the
|
|
Re: Fedora build issues
Mike Schonberg <mschonberg@...>
toggle quoted messageShow quoted text
-----Original Message-----This file needs to be copied over manually. I believe the README file documents this. We usually download the Avis archives rather than pulling from SVN. It is possible that the SVN version is different. -Mike Please consider the environment before printing this email. Visit our website at http://www.nyse.com **************************************************** Note: The information contained in this message and any attachment to it is privileged, confidential and protected from disclosure. If the reader of this message is not the intended recipient, or an employee or agent responsible for delivering this message to the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please notify the sender immediately by replying to the message, and please delete it from your system. Thank you. NYSE Euronext.
|
|
Re: Fedora build issues
William Henry <whenry@...>
Okay so here's what's wrong now and what I did to get to wrong and what I'm doing to fix it.
toggle quoted messageShow quoted text
The ./configure flags the avis_client_config.h file. So after svn co the avis source. I copied this file (well one of them - there are four but no "linux") to /usr/local/include/avis. That got me by the ./configure However it seems that more .h files are needed in this directory for the build. So I'll copy them over one by one. Later: actually I just copied the entire directory over. Now I'm getting: bridge.c: In function 'avisBridge_getVersion': bridge.c:65:30: error: 'VERSION' undeclared (first use in this function) bridge.c:65:30: note: each undeclared identifier is reported only once for each function it appears in bridge.c:66:1: warning: control reaches end of non-void function [-Wreturn-type] make[5]: *** [bridge.lo] Error 1 make[5]: Leaving directory `/home/whenry/os/openmamam/OpenMAMA-1.1/mama/c_cpp/src/c/bridge/avis' make[4]: *** [install-recursive] Error 1 make[4]: Leaving directory `/home/whenry/os/openmamam/OpenMAMA-1.1/mama/c_cpp/src/c/bridge' make[3]: *** [install-recursive] Error 1 make[3]: Leaving directory `/home/whenry/os/openmamam/OpenMAMA-1.1/mama/c_cpp/src/c' make[2]: *** [install-recursive] Error 1 make[2]: Leaving directory `/home/whenry/os/openmamam/OpenMAMA-1.1/mama/c_cpp/src' make[1]: *** [install-recursive] Error 1 make[1]: Leaving directory `/home/whenry/os/openmamam/OpenMAMA-1.1/mama/c_cpp' I wonder if I have the correct .h file versions. William
----- Original Message -----
Got the build at least going now with the avis stuff installed.
|
|