Copyright © 2005 - 2014 Informatica
Informatica Ultra Messaging
Version 5.3
March 2014
Copyright (c) 1998-2014 Informatica Corporation. All rights reserved.
This software and documentation contain proprietary information of Informatica Corporation and are provided under a license agreement containing restrictions on use and disclosure and are also protected by copyright law. Reverse engineering of the software is prohibited. No part of this document may be reproduced or transmitted in any form, by any means (electronic, photocopying, recording or otherwise) without prior consent of Informatica Corporation. This Software may be protected by U.S. and/or international Patents and other Patents Pending.
Use, duplication, or disclosure of the Software by the U.S. Government is subject to the restrictions set forth in the applicable software license agreement and as provided in DFARS 227.7202-1(a) and 227.7702-3(a) (1995), DFARS 252.227-7013(c)(1)(ii) (OCT 1988), FAR 12.212(a) (1995), FAR 52.227-19, or FAR 52.227-14 (ALT III), as applicable.
The information in this product or documentation is subject to change without notice. If you find any problems in this product or documentation, please report them to us in writing.
Informatica, Informatica Platform, Informatica Data Services, PowerCenter, PowerCenterRT, PowerCenter Connect, PowerCenter Data Analyzer, PowerExchange, PowerMart, Metadata Manager, Informatica Data Quality, Informatica Data Explorer, Informatica B2B Data Transformation, Informatica B2B Data Exchange Informatica On Demand, Informatica Identity Resolution, Informatica Application Information Lifecycle Management, Informatica Complex Event Processing, Ultra Messaging and Informatica Master Data Management are trademarks or registered trademarks of Informatica Corporation in the United States and in jurisdictions throughout the world. All other company and product names may be trade names or trademarks of their respective owners.
Portions of this software and/or documentation are subject to copyright held by third parties, including without limitation: Copyright DataDirect Technologies. All rights reserved. Copyright (c) Sun Microsystems. All rights reserved. Copyright (c) RSA Security Inc. All Rights Reserved. Copyright (c) Ordinal Technology Corp. All rights reserved.Copyright (c) Aandacht c.v. All rights reserved. Copyright Genivia, Inc. All rights reserved. Copyright Isomorphic Software. All rights reserved. Copyright (c) Meta Integration Technology, Inc. All rights reserved. Copyright (c) Intalio. All rights reserved. Copyright (c) Oracle. All rights reserved. Copyright (c) Adobe Systems Incorporated. All rights reserved. Copyright (c) DataArt, Inc. All rights reserved. Copyright (c) ComponentSource. All rights reserved. Copyright (c) Microsoft Corporation. All rights reserved. Copyright (c) Rogue Wave Software, Inc. All rights reserved. Copyright (c) Teradata Corporation. All rights reserved. Copyright (c) Yahoo! Inc. All rights reserved. Copyright (c) Glyph & Cog, LLC. All rights reserved. Copyright (c) Thinkmap, Inc. All rights reserved. Copyright (c) Clearpace Software Limited. All rights reserved. Copyright (c) Information Builders, Inc. All rights reserved. Copyright (c) OSS Nokalva, Inc. All rights reserved. Copyright Edifecs, Inc. All rights reserved. Copyright Cleo Communications, Inc. All rights reserved. Copyright (c) International Organization for Standardization 1986. All rights reserved. Copyright (c) ej-technologies GmbH. All rights reserved. Copyright (c) Jaspersoft Corporation. All rights reserved. Copyright (c) is International Business Machines Corporation. All rights reserved. Copyright (c) yWorks GmbH. All rights reserved. Copyright (c) Lucent Technologies. All rights reserved. Copyright (c) University of Toronto. All rights reserved. Copyright (c) Daniel Veillard. All rights reserved. Copyright (c) Unicode, Inc. Copyright IBM Corp. All rights reserved. Copyright (c) MicroQuill Software Publishing, Inc. All rights reserved. Copyright (c) PassMark Software Pty Ltd. All rights reserved. Copyright (c) LogiXML, Inc. All rights reserved. Copyright (c) 2003-2010 Lorenzi Davide, All rights reserved. Copyright (c) Red Hat, Inc. All rights reserved. Copyright (c) The Board of Trustees of the Leland Stanford Junior University. All rights reserved. Copyright (c) EMC Corporation. All rights reserved. Copyright (c) Flexera Software. All rights reserved. Copyright (c) Jinfonet Software. All rights reserved. Copyright (c) Apple Inc. All rights reserved. Copyright (c) Telerik Inc. All rights reserved.
This product includes software developed by the Apache Software Foundation (http://www.apache.org/), and/or other software which is licensed under various versions of the Apache License (the "License"). You may obtain a copy of these Licenses at http://www.apache.org/licenses/. Unless required by applicable law or agreed to in writing, software distributed under these Licenses is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the Licenses for the specific language governing permissions and limitations under the Licenses.
This product includes software which was developed by Mozilla (http://www.mozilla.org/), software copyright The JBoss Group, LLC, all rights reserved; software copyright (c) 1999-2006 by Bruno Lowagie and Paulo Soares and other software which is licensed under various versions of the GNU Lesser General Public License Agreement, which may be found at http:// www.gnu.org/licenses/lgpl.html. The materials are provided free of charge by Informatica, "as-is", without warranty of any kind, either express or implied, including but not limited to the implied warranties of merchantability and fitness for a particular purpose.
The product includes ACE(TM) and TAO(TM) software copyrighted by Douglas C. Schmidt and his research group at Washington University, University of California, Irvine, and Vanderbilt University, Copyright (c) 1993-2006, all rights reserved.
This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit (copyright The OpenSSL Project. All Rights Reserved) and redistribution of this software is subject to terms available at http://www.openssl.org and http://www.openssl.org/source/license.html.
This product includes Curl software which is Copyright 1996-2007, Daniel Stenberg, <daniel@haxx.se>. All Rights Reserved. Permissions and limitations regarding this software are subject to terms available at http://curl.haxx.se/docs/copyright.html. Permission to use, copy, modify, and distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.
The product includes software copyright 2001-2005 (c) MetaStuff, Ltd. All Rights Reserved. Permissions and limitations regarding this software are subject to terms available at http://www.dom4j.org/ license.html.
The product includes software copyright (c) 2004-2007, The Dojo Foundation. All Rights Reserved. Permissions and limitations regarding this software are subject to terms available at http://dojotoolkit.org/license.
This product includes ICU software which is copyright International Business Machines Corporation and others. All rights reserved. Permissions and limitations regarding this software are subject to terms available at http://source.icu-project.org/repos/icu/icu/trunk/license.html.
This product includes software copyright (c) 1996-2006 Per Bothner. All rights reserved. Your right to use such materials is set forth in the license which may be found at http:// www.gnu.org/software/ kawa/Software-License.html.
This product includes OSSP UUID software which is Copyright (c) 2002 Ralf S. Engelschall, Copyright (c) 2002 The OSSP Project Copyright (c) 2002 Cable & Wireless Deutschland. Permissions and limitations regarding this software are subject to terms available at http://www.opensource.org/licenses/mit-license.php.
This product includes software developed by Boost (http://www.boost.org/) or under the Boost software license. Permissions and limitations regarding this software are subject to terms available at http:/ /www.boost.org/LICENSE_1_0.txt.
This product includes software copyright (c) 1997-2007 University of Cambridge. Permissions and limitations regarding this software are subject to terms available at http:// www.pcre.org/license.txt.
This product includes software copyright (c) 2007 The Eclipse Foundation. All Rights Reserved. Permissions and limitations regarding this software are subject to terms available at http:// www.eclipse.org/org/documents/epl-v10.php.
This product includes software licensed under the terms at http://www.tcl.tk/software/tcltk/license.html, http://www.bosrup.com/web/overlib/?License, http://www.stlport.org/doc/ license.html, http:// asm.ow2.org/license.html, http://www.cryptix.org/LICENSE.TXT, http://hsqldb.org/web/hsqlLicense.html, http://httpunit.sourceforge.net/doc/ license.html, http://jung.sourceforge.net/license.txt , http://www.gzip.org/zlib/zlib_license.html, http://www.openldap.org/software/release/license.html, http://www.libssh2.org, http://slf4j.org/license.html, http://www.sente.ch/software/OpenSourceLicense.html, http://fusesource.com/downloads/license-agreements/fuse-message-broker-v-5-3- license-agreement; http://antlr.org/license.html; http://aopalliance.sourceforge.net/; http://www.bouncycastle.org/licence.html; http://www.jgraph.com/jgraphdownload.html; http://www.jcraft.com/jsch/LICENSE.txt; http://jotm.objectweb.org/bsd_license.html; . http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231; http://www.slf4j.org/license.html; http://nanoxml.sourceforge.net/orig/copyright.html; http://www.json.org/license.html; http://forge.ow2.org/projects/javaservice/, http://www.postgresql.org/about/licence.html, http://www.sqlite.org/copyright.html, http://www.tcl.tk/software/tcltk/license.html, http://www.jaxen.org/faq.html, http://www.jdom.org/docs/faq.html, http://www.slf4j.org/license.html; http://www.iodbc.org/dataspace/iodbc/wiki/iODBC/License; http://www.keplerproject.org/md5/license.html; http://www.toedter.com/en/jcalendar/license.html; http://www.edankert.com/bounce/index.html; http://www.net-snmp.org/about/license.html; http://www.openmdx.org/#FAQ; http://www.php.net/license/3_01.txt; http://srp.stanford.edu/license.txt; http://www.schneier.com/blowfish.html; http://www.jmock.org/license.html; http://xsom.java.net; and http://benalman.com/about/license/; https://github.com/CreateJS/EaselJS/blob/master/src/easeljs/display/Bitmap.js; http://www.h2database.com/html/license.html#summary; and http://jsoncpp.sourceforge.net/LICENSE.
This product includes software licensed under the Academic Free License http://www.opensource.org/licenses/afl-3.0.php), the Common Development and Distribution License (http://www.opensource.org/licenses/cddl1.php) the Common Public License (http://www.opensource.org/licenses/cpl1.0.php), the Sun Binary Code License Agreement Supplemental License Terms, the BSD License (http:// www.opensource.org/licenses/bsd-license.php) the MIT License (http://www.opensource.org/licenses/mit-license.php) and the Artistic License (http://www.opensource.org/licenses/artistic-license-1.0).
This product includes software copyright (c) 2003-2006 Joe WaInes, 2006-2007 XStream Committers. All rights reserved. Permissions and limitations regarding this software are subject to terms available at http://xstream.codehaus.org/license.html. This product includes software developed by the Indiana University Extreme! Lab. For further information please visit http://www.extreme.indiana.edu/.
This Software is protected by U.S. Patent Numbers 5,794,246; 6,014,670; 6,016,501; 6,029,178; 6,032,158; 6,035,307; 6,044,374; 6,092,086; 6,208,990; 6,339,775; 6,640,226; 6,789,096; 6,820,077; 6,823,373; 6,850,947; 6,895,471; 7,117,215; 7,162,643; 7,243,110, 7,254,590; 7,281,001; 7,421,458; 7,496,588; 7,523,121; 7,584,422; 7676516; 7,720,842; 7,721,270; and 7,774,791, international Patents and other Patents Pending.
DISCLAIMER: Informatica Corporation provides this documentation "as is" without warranty of any kind, either express or implied, including, but not limited to, the implied warranties of noninfringement, merchantability, or use for a particular purpose. Informatica Corporation does not warrant that this software or documentation is error free. The information provided in this software or documentation may include technical inaccuracies or typographical errors. The information in this software and documentation is subject to change at any time without notice.
NOTICES
This Informatica product (the "Software") includes certain drivers (the "DataDirect Drivers") from DataDirect Technologies, an operating company of Progress Software Corporation ("DataDirect") which are subject to the following terms and conditions:
1. THE DATADIRECT DRIVERS ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
2. IN NO EVENT WILL DATADIRECT OR ITS THIRD PARTY SUPPLIERS BE LIABLE TO THE END-USER CUSTOMER FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, CONSEQUENTIAL OR OTHER DAMAGES ARISING OUT OF THE USE OF THE ODBC DRIVERS, WHETHER OR NOT INFORMED OF THE POSSIBILITIES OF DAMAGES IN ADVANCE. THESE LIMITATIONS APPLY TO ALL CAUSES OF ACTION, INCLUDING, WITHOUT LIMITATION, BREACH OF CONTRACT, BREACH OF WARRANTY, NEGLIGENCE, STRICT LIABILITY, MISREPRESENTATION AND OTHER TORTS.
This document provides step-by-step instructions on how to rapidly get started using Ultra Messaging® high performance message streaming. For information about Parallel Persistence® and UMQ operations see The Ultra Messaging Guide for Persistence and Queuing.
This document gets you started using our pre-compiled evaluation binaries to test performance, and then walks you through the steps of writing minimal source (sender) and receiver applications.
A Ultra Messaging software evaluation kit consists of the documentation package (which includes this document) and one or more binary packages. These instructions will help get you started evaluating Ultra Messaging quickly. You can run pre-compiled commands from a Ultra Messaging binary distribution to get some quick performance numbers in your environment. (A subsequent section guides you through creation of simple programs for local compilation.)
Important: If you plan to test multiple machines communicating with each other, the machines will need multicast connectivity between them. Contact your network administrator for information on multicast connectivity. If multicast connectivity is not possible, the test applications can all be run on the same machine. Alternatively, it is possible to configure Ultra Messaging to avoid multicast, see Unicast-Only Operation.
A binary package consists of:
Binary versions of source code examples (see the bin directory)
Header files (see the include directory)
Link libraries (see the lib directory)
Shared libraries (see the lib directory on Unix for .so files or the bin directory on Windows for .dll files)
The Ultra Messaging code and documentation are copyrighted and confidential information owned by Informatica and are covered under the terms of our Software License Agreement or Non-Disclosure Agreement as appropriate. Use of this code and documentation without a valid Non-Disclosure Agreement or Software License Agreement with Informatica Corporation is strictly prohibited. If this code and documentation is being supplied under the terms of a Non Disclosure Agreement, all copies, in any form, must be returned or destroyed at the end of the evaluation period or as requested by Informatica.
The following steps assume that the windows package is installed on all test machines in the standard place:
C:\Program Files\29West\rel-id\Win2k-i386
where rel-id is the release identifier. It is also assumed that the \bin directory is included in the windows PATH environment variable. This is needed so that the .EXE and .DLL files can be found.
Open a command prompt window on the machine you want to use for receiving messages and enter the command lbmrcv topic to start a receiver. Note that topic can be any string. You should see output that looks something like this:
1.006 secs. 0.0 Kmsgs/sec. 0.0 Kbps 1.019 secs. 0.0 Kmsgs/sec. 0.0 Kbps 1.010 secs. 0.0 Kmsgs/sec. 0.0 Kbps
A new line will be printed about once per second showing the elapsed time, messages received, and data received. As long as there are no sources yet running on topic, the number of messages received will continue to be zero.
Open a command prompt window on the machine you want to use for sending messages and enter the command lbmsrc topic to start sending messages. The receiver will automatically discover the source, at which time its output will change to something like this:
1.010 secs. 451.9 Kmsgs/sec. 90.4 Mbps 1.010 secs. 451.4 Kmsgs/sec. 90.3 Mbps 1.010 secs. 445.1 Kmsgs/sec. 89.0 Mbps
With no options given, the source will send 10,000,000 small (25 byte) messages. If you would like to test different size packets or number of packets sent, you can set options. Enter lbmsrc -h at the command line, you will get a list of options you can control.
Press Ctrl-C to kill the source or receiver.
The following steps assume that the Unix package is installed on all test machines under a normal user account:
/home/user-id/lbmeval/rel-id/platform-id
where rel-id is the release identifier and platform-id describes the ABI (Application Binary Interface - e.g. Linux-2.4-glibc-2.2-i686). It is also assumed that the /bin directory is included in the PATH environment variable and the /lib directory is in the appropriate loader library search path environment variable (e.g. LD_LIBRARY_PATH for Linux; see http://bhami.com/rosetta.html for equivalences in other flavors of Unix).
Open a command prompt window on the machine you want to use for receiving messages and enter the command lbmrcv topic to start a receiver. Note that topic can be any string. You should see output that looks something like this:
1.006 secs. 0.0 Kmsgs/sec. 0.0 Kbps 1.019 secs. 0.0 Kmsgs/sec. 0.0 Kbps 1.010 secs. 0.0 Kmsgs/sec. 0.0 Kbps
A new line will be printed about once per second showing the elapsed time, messages received, and data received. As long as there are no sources yet running on topic, the number of messages received will continue to be zero.
Open a command prompt window on the machine you want to use for sending messages and enter the command lbmsrc topic to start sending messages. The receiver will automatically discover the source, at which time its output will change to something like this:
1.010 secs. 451.9 Kmsgs/sec. 90.4 Mbps 1.010 secs. 451.4 Kmsgs/sec. 90.3 Mbps 1.010 secs. 445.1 Kmsgs/sec. 89.0 Mbps
With no options given, the source will send 10,000,000 small (25 byte) messages. If you would like to test different size packets or number of packets sent, you can set options. Enter lbmsrc -h at the command line, you will get a list of options you can control.
Press Ctrl-C to kill the source or receiver.
There are many other example programs available. See doc/example/index.html for documentation on all of them.
For general information on measuring performance, see the UM Knowledgebase article Performance Testing.
For information on testing the LBT-RM (multicast) transport, see the following UM Knowledgebase articles:
Microsoft has batching issues in its networking stack, so the performance results can vary. We have a work around if this is an issue for you.
The Linux version was compiled on Fedora Core 1.
The Windows version was compiled on Windows XP with Microsoft Visual C++ version 7.
The C programs below contain the minimum code and supporting material. Their purpose is to verify that the user's build and run-time environments are set up correctly. They also give a basic introduction to the Ultra Messaging API.
We also have equivalent Java and C# programs available in source form. See MinSrc.java and MinRcv.java or MinSrc.cs and MinRcv.cs We also have an example of how application callbacks are coded in C++ programs. See minrcv.cpp (Most browsers let you right-click on the link and use the save link target function, or some variation.)
Note that these programs do not allow the user to override any of the default configuration values. As a result, operation is fixed according to the normal LBM defaults; for example TCP is the transport protocol, topic resolution is performed using multicast, etc. See the Ultra Messaging Configuration Guide.
The Ultra Messaging Examples page provides a much richer set of source files that use a wide variety of features. However, those programs double as performance testing tools, so they tend to be more complex than just demonstrating the features. We recommend to first build and run these minimal examples.
This source code example is provided by Informatica for educational and evaluation purposes only.
Error handling in these programs is primitive. A production program would want to have better error handling, but for the purposes of a minimal example, it would just be a distraction. Also, a production program would want to support a configuration file to override default values on options.
When building on Windows, the following notes are applicable.
Make sure the preprocessor variable "WIN32" is defined. From Visual Studio 6, navigate: "Project"->"Settings...", "C/C++", "Category:General", "Preprocessor definitions:".
Add C:\Program Files\29West\<VERS>\Win2k-i386\include\lbm as an additional include directory (where "<VERS>" is the appropriate version identifier). From Visual Studio 6, navigate: "Project"->"Settings...", "C/C++", "Category:Preprocessor", "Additional include directories:"
Add lbm.lib and wsock32.lib as Object/library modules. From Visual Studio 6, navigate: "Project"->"Settings...", "Link", "Category:General", "Object/library modules:"
Add C:\Program Files\29West\VERS\Win2k-i386\lib as an additional library path (where VERS is the appropriate version identifier). From Visual Studio 6, navigate: "Project"->"Settings...", "Link", "Category:Input", "Additional library path:"
The install procedure should already have added the LBM bin directory to the Windows PATH. This is necessary so that lbm.dll can be found when a program is run. To modify the Windows PATH from Windows XP, navigate: "right-click My Computer"->"properties", "Advanced", "Environment variables", "System variables:Path", "Edit"
When building on Unix, the following notes are applicable.
Sample build command:
cc -I$HOME/lbm/<VERS>/<PLATFORM>/include -L$HOME/lbm/<VERS>/<PLATFORM>/lib -llbm -lm -o min_src min_src.c(This should be all one line.)
The appropriate library search path should be updated to include the Ultra Messaging lib/ directory. For example, on Linux:
LD_LIBRARY_PATH="$HOME/lbm/<VERS>/<PLATFORM>/lib:$LD_LIBRARY_PATH" export LD_LIBRARY_PATH(For other flavors of Unix, see http://bhami.com/rosetta.html.) Alternatively, the shared library can be copied from the LBM lib/ directory to a directory which is already in the library search path.
This is a source code listing of a minimal source (sender) program. You may find it helpful to download the source code (most browsers let you right-click on the link and use the save link target function, or some variation). We also have equivalent Java and C# programs available in source form. See MinSrc.java and MinSrc.cs.
/*file: minsrc.c - minimal source (sender) program. * * Copyright (c) 2005-2014 Informatica Corporation. All Rights Reserved. * Permission is granted to licensees to use * or alter this software for any purpose, including commercial applications, * according to the terms laid out in the Software License Agreement. */ #include <stdio.h> #if defined(_MSC_VER) /* Windows-only includes */ #include <winsock2.h> #define SLEEP(s) Sleep((s)*1000) #else /* Unix-only includes */ #include <stdlib.h> #include <unistd.h> #define SLEEP(s) sleep(s) #endif #include <lbm/lbm.h> main() { lbm_context_t *ctx; /* pointer to context object */ lbm_topic_t *topic; /* pointer to topic object */ lbm_src_t *src; /* pointer to source (sender) object */ int err; /* return status of lbm functions (true=error) */ #if defined(_MSC_VER) /* windows-specific code */ WSADATA wsadata; int wsStat = WSAStartup(MAKEWORD(2,2), &wsadata); if (wsStat != 0) { printf("line %d: wsStat=%d\n",__LINE__,wsStat); exit(1); } #endif err = lbm_context_create(&ctx, NULL, NULL, NULL); if (err) { printf("line %d: %s\n", __LINE__, lbm_errmsg()); exit(1); } err = lbm_src_topic_alloc(&topic, ctx, "Greeting", NULL); if (err) { printf("line %d: %s\n", __LINE__, lbm_errmsg()); exit(1); } err = lbm_src_create(&src, ctx, topic, NULL, NULL, NULL); if (err) { printf("line %d: %s\n", __LINE__, lbm_errmsg()); exit(1); } SLEEP(3); err = lbm_src_send(src, "Hello!", 6, LBM_MSG_FLUSH | LBM_SRC_BLOCK); if (err) { printf("line %d: %s\n", __LINE__, lbm_errmsg()); exit(1); } /* Finished all sending to this topic, delete the source object. */ SLEEP(2); lbm_src_delete(src); /* Do not need to delete the topic object - LBM keeps track of topic * objects and deletes them as-needed. */ /* Finished with all LBM functions, delete the context object. */ lbm_context_delete(ctx); #if defined(_MSC_VER) WSACleanup(); #endif } /* main */
Notes:
This is a source code listing of a minimal receiver program. You may find it helpful to download the source code (most browsers let you right-click on the link and use the save link target function, or some variation). We also have equivalent Java, C#, and C++ programs available in source form. See MinRcv.java MinRcv.cs and minrcv.cpp.
/*file: minrcv.c - minimal receiver program. * * Copyright (c) 2005-2014 Informatica Corporation. All Rights Reserved. * Permission is granted to licensees to use * or alter this software for any purpose, including commercial applications, * according to the terms laid out in the Software License Agreement. */ #include <stdio.h> #if defined(_MSC_VER) /* Windows-only includes */ #include <winsock2.h> #define SLEEP(s) Sleep((s)*1000) #else /* Unix-only includes */ #include <stdlib.h> #include <unistd.h> #define SLEEP(s) sleep(s) #endif #include <lbm/lbm.h> /* * A global variable is used to communicate from the receiver callback to * the main application thread. */ int msgs_rcvd = 0; int app_rcv_callback(lbm_rcv_t *rcv, lbm_msg_t *msg, void *clientd) { /* There are several different events that can cause the receiver callback * to be called. Decode the event that caused this. */ switch (msg->type) { case LBM_MSG_DATA: /* a received message */ printf("Received %d bytes on topic %s: '%.*s'\n", msg->len, msg->topic_name, msg->len, msg->data); /* Tell main thread that we've received our message. */ ++ msgs_rcvd; break; case LBM_MSG_BOS: printf("[%s][%s], Beginning of Transport Session\n", msg->topic_name, msg->source); break; case LBM_MSG_EOS: printf("[%s][%s], End of Transport Session\n", msg->topic_name, msg->source); break; default: /* unexpected receiver event */ printf("Received lbm_msg_t type %x [%s][%s]\n", msg->type, msg->topic_name, msg->source); break; } /* switch msg->type */ return 0; } /* app_rcv_callback */ main() { lbm_context_t *ctx; /* pointer to context object */ lbm_topic_t *topic; /* pointer to topic object */ lbm_rcv_t *rcv; /* pointer to receiver object */ int err; /* return status of lbm functions (true=error) */ #if defined(_MSC_VER) /* windows-specific code */ WSADATA wsadata; int wsStat = WSAStartup(MAKEWORD(2,2), &wsadata); if (wsStat != 0) { printf("line %d: wsStat=%d\n",__LINE__,wsStat); exit(1); } #endif err = lbm_context_create(&ctx, NULL, NULL, NULL); if (err) { printf("line %d: %s\n", __LINE__, lbm_errmsg()); exit(1); } err = lbm_rcv_topic_lookup(&topic, ctx, "Greeting", NULL); if (err) { printf("line %d: %s\n", __LINE__, lbm_errmsg()); exit(1); } err = lbm_rcv_create(&rcv, ctx, topic, app_rcv_callback, NULL, NULL); if (err) { printf("line %d: %s\n", __LINE__, lbm_errmsg()); exit(1); } while (msgs_rcvd == 0) SLEEP(1); /* Finished all receiving from this topic, delete the receiver object. */ lbm_rcv_delete(rcv); /* Do not need to delete the topic object - LBM keeps track of topic * objects and deletes them as-needed. */ /* Finished with all LBM functions, delete the context object. */ lbm_context_delete(ctx); #if defined(_MSC_VER) WSACleanup(); #endif } /* main */
Notes:
One of Ultra Messaging's great strengths is its use of the network hardware and protocols to achieve very high performance and scalability. By default, Ultra Messaging uses multicast for topic resolution so that data sources and receivers can find each other.
In general, we recommend the use of multicast whenever possible because it provides the best performance and scalability. However, we recognize that it is not always possible to provide multicast connectivity between the machines. For those cases, we support unicast-only operation.
There are two parts to unicast-only operation. One is to use a unicast form of transport. Ultra Messaging uses TCP by default for transport, but LBT-RU is also available and has some performance advantages. For initial "quick start" testing, we recommend not changing the default TCP.
The second part of unicast-only operation is to use the lbmrd (UM Resolver Daemon) for topic resolution. (NOTE: this does not route message data through a daemon. This is a helper process that lets data sources and receivers find each other.) To enable unicast topic resolution, do the following:
Choose one machine to host the resolver daemon and enter the lbmrd command (use lbmrd -h for full instructions).
Create a Ultra Messaging configuration file containing:
context resolver_unicast_daemon [Iface[:Src_Port]->]IP:Dest_Port
where
Iface is the interface to use (previously set with resolver_unicast_interface).
Src_Port is the source port to use (previously set with resolver_unicast_port).
IP is the resolver daemon's IP address (previously set with resolver_unicast_address).
Dest_Port is the resolver daemon's UDP port (previously set with resolver_unicast_destination_port).
Run the test applications with the option -c filename where filename is the configuration file created in step 2.
See also resolver_unicast_daemon.
Due to the fact that the minimal source programs presented in this document (minsrc.c and minrcv.c) do not allow the use of a configuration file, it is not possible to configure them for unicast-only operation. If multicast operation is not possible on your network, then please use the binary test programs (described in Section 2) which which do allow unicast-only configuration.
UMQ also includes a Ultra Messaging JMS evaluation package. You can run pre-compiled commands from an Ultra Messaging JMS distribution to get some quick performance numbers in your environment. (A subsequent section guides you through creation of simple programs for local compilation.)
Important: The application demonstrations described below assume that you will use a single machine. If you plan to test multiple machines communicating with each other, the machines will need multicast connectivity between them. Contact your network administrator for information on multicast connectivity.
An Ultra Messaging JMS evaluation package includes the following.
Ultra Messaging JMS jar file that contains the Ultra Messaging JMS and compiled example applications. (See the jmsclient/lib directory.)
JMS jar file and other 3rd party jar files (See the jmsclient/lib directory.)
Example source code (see the doc/jms_example/*.java directory)
The Ultra Messaging JMS code and documentation are copyrighted and confidential information owned by Informatica Corporation and are covered under the terms of our Software License Agreement or Non-Disclosure Agreement as appropriate. Use of this code and documentation without a valid Non-Disclosure Agreement or Software License Agreement with Informatica, Inc. is strictly prohibited. If this code and documentation is being supplied under the terms of a Non Disclosure Agreement, all copies, in any form, must be returned or destroyed at the end of the evaluation period or as requested by Informatica Corporation.
Note: For Windows installations, you must also install the Microsoft Visual C++ 2005 Service Pack 1 Redistributable Package MFC Security Update, which is available on the download page and contains runtime components of the Visual C++ Libraries.
Note: The Ultra Messaging JMS JAR installation is not compatible with Microsoft® Windows® due to a new dependency on libeay32.dll. As a workaround, set use_native_loader=false and load the dependencies from the PATH.
Perform the following steps to configure Ultra Messaging JMS for a Unix environment.
Edit the bin/env.sh file to configure your environment. You must set the following two variables.
export JAVA_HOME="/usr/local/jdk1.6.0_16" export LBM_LICENSE_FILENAME=/home/user/lbm.lic
Run startJMS.sh. You can now run any of the example applications with the appropriate script. See Microsoft Windows or Unix.
Note: If you make any changes to the config.xml file to test different aspects of Ultra Messaging JMS, you must re-run the "config.sh" script. This re-creates a .bindings file from the config.xml file that all example programs use.
The following steps assume that Microsoft Windows is installed in the standard place.
Note: It is critical that you set the Microsoft Windows PATH environment variable to include the location of the UMQ product installation bin directory. In particular, iconv.dll from the bin directory must be in the executable's dll search path at runtime.
Set the following three environment variables.
set JAVA_HOME=C:\Program Files\Java\jdk1.6 set JAVA_BIN=%JAVA_HOME%\bin set LBM_LICENSE_FILENAME=C:\lbm.lic
Note: Your Java directory may be different, such as jre6. Also, your license file path or name may vary.
Run startJMS.bat. You can now run any of the example applications with the appropriate script.
Note: If you make any changes to the config.xml file to test different aspects of Ultra Messaging JMS, you must re-run the "config.bat" script. This re-creates a .bindings file from the config.xml file that all example programs use.
All source for the following example applications is Java.
If you are running on Microsoft Windows you will execute a .bat file.
If you are running a Unix system, you will execute a .sh file.
Follow the steps below to demonstrate Ultra Messaging JMS request/reply. This demonstration uses Reply.java and Request.java source files and requires a UME server.
Open a command prompt window and enter the command reply.sh or reply.bat for Microsoft Windows.
Open a second command prompt window and enter the command request.sh or request.bat for Microsoft Windows.
You will see output that indicates the message has been sent back and forth. Press Ctrl-C to kill either application.
Follow the steps below to demonstrate Ultra Messaging JMS synchronous and asynchronous message delivery. This demonstration uses AsyncConsumer.java, Producer.java and SyncConsumer.java source files.
Open a command prompt window and enter the command AsyncConsumer.sh or AsyncConsumer.bat for Microsoft Windows.
Open a second command prompt window and enter the command Producer.sh or Producer.bat for Microsoft Windows.
Open a third command prompt window and enter the command SyncConsumer.sh or SyncConsumer.bat for Microsoft Windows.
For the Producer, you will see output similar to the following.
Sent ********* This is a test *********** Sent ********* This is a test *********** Sent ********* This is a test *********** Sent ********* This is a test *********** Sent ********* This is a test *********** Sent ********* This is a test *********** Sent ********* This is a test *********** Sent ********* This is a test *********** Sent ********* This is a test *********** Sent ********* This is a test ***********
For the AsyncConsumer and the SyncConsumer, you will see output similar to the following.
Received message: ********* This is a test *********** Received message: ********* This is a test *********** Received message: ********* This is a test *********** Received message: ********* This is a test *********** Received message: ********* This is a test *********** Received message: ********* This is a test *********** Received message: ********* This is a test *********** Received message: ********* This is a test *********** Received message: ********* This is a test *********** Received message: ********* This is a test ***********
Press Ctrl-C to kill any application.
Follow the steps below to demonstrate Ultra Messaging JMS durable consumer messaging. This demonstration uses DurableConsumer.java and DurableProducer.java source files and requires a UME server.
Open a command prompt window and enter the command DurableConsumer.sh or DurableConsumer.bat for Microsoft Windows.
Open a second command prompt window and enter the command DurableProducer.sh or DurableProducer.bat for Microsoft Windows. The DurableProducer sends 20 messages.
In the command prompt window for the DurableConsumer, you should see output similar to the following.
Reading message: This is message 1 Reading message: This is message 2 Reading message: This is message 3 Reading message: This is message 4 Reading message: This is message 5 Reading message: This is message 6 Reading message: This is message 7 Reading message: This is message 8
After message 8, press Ctrl-C to kill the DurableConsumer. Then restart the consumer. The remaining 12 messages sent by the DurableProducer appear in the window.
Reading message: This is message 9 Reading message: This is message 10 Reading message: This is message 11 Reading message: This is message 12 Reading message: This is message 13 Reading message: This is message 14 Reading message: This is message 15 Reading message: This is message 16 Reading message: This is message 17 Reading message: This is message 18 Reading message: This is message 19 Reading message: This is message 20
Follow the steps below to demonstrate Ultra Messaging JMS queuing. This demonstration uses QueueReceiver.java and QueueSender.java.java source files and requires a UMQ server.
Open two command prompt windows and in each window, enter the command QueueReceiver.sh or QueueReceiver.bat for Microsoft Windows.
Open a third command prompt window and enter the command QueueSender.sh or QueueSender.bat for Microsoft Windows. The QueueSender sends 15 messages; odd numbered messages go to the QueueReceiver in Window 1 and even numbered messages to QueueReceiver in Window 2.
Output for QueueReceiver in Window 1.
Reading message: This is message 1 Reading message: This is message 3 Reading message: This is message 5 Reading message: This is message 7 Reading message: This is message 9 Reading message: This is message 11 Reading message: This is message 13 Reading message: This is message 15
Output for QueueReceiver in Window 2.
Reading message: This is message 2 Reading message: This is message 4 Reading message: This is message 6 Reading message: This is message 8 Reading message: This is message 10 Reading message: This is message 12 Reading message: This is message 14
Press Ctrl-C to kill any application.
To achieve lower latency for this example application, you should change the value of implicit_batching_minimum_length from 2000 to 1 in the config.xml file.
To achieve lower latency for this example application, you should change the value of implicit_batching_minimum_length from 2000 to 1 in the config.xml file.
This source code example is provided by Informatica for educational and evaluation purposes only. Error handling in these programs is primitive. A production program would want to have better error handling, but for the purposes of a minimal example, it would just be a distraction. Also, a production program would want to support a configuration file to override default values on options.
When building on Windows, use the following compile line. (QueueReceiver.java is the application being compiled.)
$JAVA_HOME/bin/javac QueueReceiver.java -cp $JMS_HOME/lib/uJMS_1.0.jar;$JMS_HOME/lib/jms.jar
When building on Unix, use the following compile line. (QueueReceiver.java is the application being compiled.)
$JAVA_HOME/bin/javac QueueReceiver.java -cp $JMS_HOME/lib/JMS_API.jar:$JMS_HOME/lib/jms.jar
This is a source code listing of a simple synchronous consumer program. You may find it helpful to download the source code (most browsers let you right-click on the link and use the save link target function, or some variation).
/*file: SimpleSyncConsumer.java * * Copyright (c) 2005-2014 Informatica Corporation. All Rights Reserved. * Permission is granted to licensees to use * or alter this software for any purpose, including commercial applications, * according to the terms laid out in the Software License Agreement. */ package examples; import javax.jms.*; import javax.naming.*; public class SyncConsumer implements ExceptionListener { public static void main(String[] args) { new SyncConsumer(); } public SyncConsumer() { Context jndiContext = null; try { jndiContext = new InitialContext(); } catch (NamingException e) { System.out.println("Could not create JNDI API " + "context: " + e.toString()); e.printStackTrace(); System.exit(1); } try { ConnectionFactory factory = (ConnectionFactory) jndiContext.lookup("uJMSConnectionFactory"); Connection connection = factory.createConnection(); // Create a Session Session session = connection.createSession(false, javax.jms.Session.AUTO_ACKNOWLEDGE); // set the exception listener callback connection.setExceptionListener(this); // Create a topic destination Destination destination = session.createTopic("TOPIC.1"); // create the consumer MessageConsumer msgConsumer = session.createConsumer(destination); connection.start(); while (true) { System.out.println("Received message " + msgConsumer.receive()); } } catch (Exception ex) { ex.printStackTrace(); } } // The exception listener public void onException(JMSException e) { // print the connection exception status System.err.println("Exception occurred: " + e.getMessage()); } }
Notes:
This is a source code listing of a simple asynchronous consumer program. You may find it helpful to download the source code (most browsers let you right-click on the link and use the save link target function, or some variation).
/*file: SimpleAsyncConsumer.java * * Copyright (c) 2005-2014 Informatica Corporation. All Rights Reserved. * Permission is granted to licensees to use * or alter this software for any purpose, including commercial applications, * according to the terms laid out in the Software License Agreement. */ package examples; import javax.jms.*; import javax.naming.*; public class AsyncConsumer implements MessageListener, ExceptionListener { public static void main(String[] args) { new AsyncConsumer(); while (true) { try { Thread.sleep(1000000); } catch (Exception ex) { ex.printStackTrace(); } } } public AsyncConsumer() { Context jndiContext = null; try { jndiContext = new InitialContext(); } catch (NamingException e) { System.out.println("Could not create JNDI API " + "context: " + e.toString()); e.printStackTrace(); System.exit(1); } try { ConnectionFactory factory = (ConnectionFactory) jndiContext.lookup("uJMSConnectionFactory"); Connection connection = factory.createConnection(); // Create a Session Session session = connection.createSession(false, javax.jms.Session.AUTO_ACKNOWLEDGE); // set the exception listener callback connection.setExceptionListener(this); // Create a topic destination Destination destination = session.createTopic("TOPIC.1"); // create the consumer MessageConsumer msgConsumer = session.createConsumer(destination); // set the message listener callback msgConsumer.setMessageListener(this); // start the connection connection.start(); } catch (Exception ex) { ex.printStackTrace(); } } // The exception listener public void onException(JMSException e) { // print the connection exception status e.printStackTrace(); } // The message listener callback public void onMessage(Message msg) { try { System.err.println("Received message: " + msg); } catch (Exception e) { System.err.println("Exception occurred: " + e.getMessage()); System.exit(-1); } } }
Notes:
This is a source code listing of a simple producer program. You may find it helpful to download the source code (most browsers let you right-click on the link and use the save link target function, or some variation).
/*file: SimpleProducer.java * * Copyright (c) 2005-2014 Informatica Corporation. All Rights Reserved. * Permission is granted to licensees to use * or alter this software for any purpose, including commercial applications, * according to the terms laid out in the Software License Agreement. */ package examples; import javax.jms.*; import javax.naming.*; public class Producer { public static void main(String[] args) { new Producer(); } public Producer() { Context jndiContext = null; try { jndiContext = new InitialContext(); } catch (NamingException e) { System.out.println("Could not create JNDI API " + "context: " + e.toString()); e.printStackTrace(); System.exit(1); } Connection connection = null; try { ConnectionFactory factory = (ConnectionFactory) jndiContext.lookup("uJMSConnectionFactory"); connection = factory.createConnection(); Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE); connection.start(); Destination destination = session.createTopic("TOPIC.1"); MessageProducer producer = session.createProducer(destination); TextMessage message = session.createTextMessage(); for (int i = 0; i < 10; i++) { ((TextMessage) message).setText("********* This is a test *********** "); producer.send(message); Thread.sleep(10); System.out.println("Sent " + message.getText()); } } catch (Exception e) { System.out.println("JNDI API lookup failed: " + e.toString()); e.printStackTrace(); System.exit(1); } finally { if (connection != null) { try { connection.close(); System.exit(0); } catch (Exception e) { e.printStackTrace(); } } } } }
Notes:
Starting UM daemons is not really a quick start operation, but the information provided in this should provide a good overview of the type of activities required to start these important UM components.
This section discusses the following topics.
The UM Gateway bridges disjoint topic resolution domains by forwarding multicast and/or unicast topic resolution traffic across gateways. Before installing and starting a gateway daemon (tnwgd) clear objectives and proper planning are very important. Approach this planning with the consideration that a gateway condenses your network into a single process. You must be clear about the traffic you expect to forward through a gateway. The following highlights some other specifics.
Know your Topic Resolution Domains. See Topic Resolution Domain.
Consider the size and quality of network paths into and out of your gateways. Obviously, gateways cannot efficiently forward message from a 1 GB path to a 100 MB path.
Fully examine any use of Late Join, taking care to configure retransmission options correctly.
All remote stores must be named stores.
The UMM Daemon stores UM XML configuration information defined in the GUI as well as user and license information. It serves license and configuration information to UM applications. The UMM Daemon requires either a MySQL™ or Oracle® database installation. Informatica does not supply MySQL or Oracle nor any licensing to use them. For additional information about the steps in this process, see UM Manager Daemon.
Note: The UMM GUI requires Java Version 1.6.x.
Install MySQL or Oracle according to the user documentation.
Create a database. (You provide the UMM Daemon with the database name, username and password at start up. This user name and password should be kept secure.)
Log into the database.
From the database's command line or home page, execute the /UMM/install_tables_oracle.sql or source /UMM/install_tables_mysql.sql script. (This script installs the tables required by UMM.)
From the database's command line or home page, load /UMM/oracle_templates.txt or /UMM/mysql_templates.txt. (This script loads the example configuration templates for low latency and high throughput. These templates appear in the UMM GUI under Templates in the object tree in the left pane.
For Oracle, load /UMM/oracle_templates.txt.
For MySQL, run LOAD DATA INFILE 'mysql_templates.txt' INTO TABLE TEMPLATE;.
From the database's command line or home page, load /UMM/oracle_application_jms.txt or /UMM/mysql_application_jms.txt. (This script loads the ConnectionFactories and Destinations required to run the example JMS applications. These templates appear in the UMM GUI under JMS/ConnectionFactory and JMS/Destination in the object tree in the left pane.)
For Oracle, load /UMM/oracle_application_jms.txt into the Application table.
For MySQL, run LOAD DATA INFILE 'mysql_application_jms.txt' INTO TABLE APPLICATION;.
Modify the /UMM/umm.properties to indicate the database username, password and driver to reflect your configuration database.
Edit the ummd.bat or ummd.sh file that starts UMM Daemon. The appropriate driver jar file name must be added to the classpath. Specify your certificate file or Java keystore information if using SSL certificates. The ummd.bat or ummd.sh provided with installation appears below.
java -cp .;mysql-connector-java-5.0.8-bin.jar;UMMD_1.6.0_02.jar -Xms512m -Xmx1024m umm.ummd.Server
Start the UMM Daemon with /UMM/ummd.bat or /UMM/ummd.sh.
Edit the umm.bat or umm.sh file that starts the UMM GUI. The appropriate driver jar file name must be added to the classpath. The umm.bat or umm.sh provided with installation appears below.
java -cp .;mysql-connector-java-5.0.8-bin.jar;UMM_1.jar; -Xms256m -Xmx1024m umm.gui.MainFrame
Start the UMM GUI with /UMM/umm.bat or /UMM/umm.sh.
Log into the UMM GUI with username, default and password default. Either change the default user's password or create new administrative user and delete the default user. See Managing Users
To enable your UM applications to be served configuration information by UMM Daemon, set the following environment variable for every application/user combination.
export LBM_UMM_INFO=<application_name>:<user_name>:<password>@<ip>:<port>
For example:
export LBM_UMM_INFO=lbmrcv:lbmrcv:default:default@10.29.3.95:21273
The daemon, umestored, provides persistent store and queue services. Follow the steps below to start umestored.
Create the cache and state directories. $ mkdir umestored-cache ; mkdir umestored-state
Create a simple umestored XML configuration file (see Configuration Reference for Umestored) or use a sample configuration, ume-example-config.xml or q-example-config.xml
Start the daemon. $ umestored config.xml
See also Manpage for umestored.
The Ultra Messaging Concepts introduces the important fundamental concepts you will need to design and code your applications.
The Ultra Messaging Examples page contains descriptions and links to source files for the binary tools used for evaluation and performance measurements. They can be a valuable resource for seeing how various features can be implemented.
The Ultra Messaging Guide for Persistence and Queuing contains concepts, tutorials and configuration information for UMP and UMQ , along with discussions about designing persistent or queuing applications. It also contains detailed configuration information for the umestored daemon.
The Ultra Messaging API documentation ( C API, Java API or .NET API) is a reference guide to the Ultra Messaging API. See also JMS API, a reference that shows which classes Ultra Messaging JMS supports.
The UM Knowledgebase contains a wealth of articles answering common support questions, error messages, new hardware issues, source code examples and more.
Copyright 2005 - 2014 Informatica Corporation.