{"id":1697,"date":"2010-07-19T14:58:30","date_gmt":"2010-07-19T19:58:30","guid":{"rendered":"http:\/\/jianmingli.com\/wp\/?p=1697"},"modified":"2011-02-16T11:15:27","modified_gmt":"2011-02-16T16:15:27","slug":"goldengate-jms-adapter-activemq-integration","status":"publish","type":"post","link":"https:\/\/jianmingli.com\/wp\/?p=1697","title":{"rendered":"GoldenGate JMS Adapter: ActiveMQ Integration"},"content":{"rendered":"<span id=\"Prepare_GoldenGate_Database_Extract_Process\"><h3>Prepare GoldenGate, Database, Extract Process<\/h3><\/span>\n<p>* See <a href=\"?p=1553\">this post<\/a> to setup GoldenGate and database.<\/p>\n<span id=\"Install_Java_Adapter\"><h3>Install Java Adapter<\/h3><\/span>\n<p>* See <a href=\"?p=1597\">this post<\/a> to setup GoldenGate Java Adapter.<\/p>\n<span id=\"Overview\"><h3>Overview<\/h3><\/span>\n<p>* Install ActiveMQ<br \/>\n* Create Data Pump<br \/>\n* Edit Params to point to user exit config file and java user exit config file<br \/>\n* Configure user exit<br \/>\n* Configure Java user exit to point to ActiveMQ.properties file<br \/>\n* Configure ActiveMQ<\/p>\n<span id=\"Install_ActiveMQ\"><h3>Install ActiveMQ<\/h3><\/span>\n<p>* Download ActiveMQ from <a href=\"http:\/\/activemq.apache.org\/download.html\">http:\/\/activemq.apache.org\/download.html<\/a>.<br \/>\n* Unzip zip download (e.g. apache-activemq-5.3.1-bin.zip) onto a local directory.<br \/>\n* Set JAVA_HOME (e.g. set JAVA_HOME=C:\\prog\\java\\jdk1.5.0_08)<br \/>\n* Start ActiveMQ by running &#8216;bin\\activemq.bat&#8217;<br \/>\n* Open ActiveQ admin page at <a href=\"http:\/\/localhost:8161\/admin\/index.jsp\">http:\/\/localhost:8161\/admin\/index.jsp<\/a><\/p>\n<span id=\"Create_Data_Pump\"><h3>Create Data Pump<\/h3><\/span>\n<p>See above.<\/p>\n<pre lang=\"bash\">ADD EXTRACT u_gt, EXTTRAILSOURCE .\/dirdat\/gt<\/pre>\n<span id=\"Edit_Data_Pump_Params\"><h3>Edit Data Pump Params<\/h3><\/span>\n<p>See above.<\/p>\n<span id=\"Setup_javaue.properties\"><h3>Setup javaue.properties<\/h3><\/span>\n<pre lang=\"bash\">\r\n# Java application properties for JMS lab using ActiveMQ as JMS server\r\n\r\n# the handlerlist defines which handlers are active\r\ngg.handlerlist=one,two,foo\r\n\r\n# the first handler is just a single file\r\ngg.handler.one.type=singlefile\r\ngg.handler.one.format=xml\r\ngg.handler.one.file=output.xml\r\n\r\ngg.handler.two.type=singlefile\r\ngg.handler.two.format=\/dirprm\/sample_tx.vm\r\ngg.handler.two.file=output.txt\r\n\r\n# jms handler: reads in activemq.properties config file too\r\ngg.handler.foo.type=jms\r\ngg.handler.foo.format=xml\r\ngg.handler.foo.properties=\/dirprm\/activemq.properties\r\ngg.handler.foo.destination=example.A\r\ngg.classpath=C:\/prog\/apache-activemq-5.3.1\/activemq-all-5.3.1.jar\r\n\r\n# (commented out) set to \"true\" to turn OFF sending jms messages\r\n# gg.handlerlist.nop=true\r\n<\/pre>\n<p>* Copy &#8216;javaue.properties&#8217; to &#8216;dirprm&#8217; directory.<br \/>\n* Copy &#8216;sample_tx.vm&#8217; to dirprm directory.<\/p>\n<span id=\"Setup_activemq.properties\"><h3>Setup activemq.properties<\/h3><\/span>\n<p>* Create &#8216;activemq.properties&#8217; file with content:<\/p>\n<pre lang=\"bash\">\r\n# if using queue\r\ngg.jmshandler.queueortopic=queue\r\ngg.jmshandler.destination=example.A\r\n\r\n# if using topic\r\n# gg.jmshandler.queueortopic=topic\r\n# gg.jmshandler.destination=ggdemo.topicA\r\n\r\n# if authentication is required\r\n# gg.jmshandler.user=\r\n# gg.jmshandler.password=\r\n\r\n# session mode (try either: auto or dupsok)\r\n#  auto:   Session.AUTO_ACKNOWLEDGE;\r\n#  client: Session.CLIENT_ACKNOWLEDGE;\r\n#  dupsok: Session.DUPS_OK_ACKNOWLEDGE;\r\ngg.jmshandler.sessionmode=dupsok\r\n\r\ngg.jmshandler.persistent=false\r\ngg.jmshandler.durabletopic=false\r\n\r\n# If using JNDI (default=true), \r\n#   then lookup managed objects from IntialContext.\r\n# Else, if NOT using JNDI,\r\n#   provide classname to instantiate a factory directly\r\ngg.jmshandler.usejndi=false\r\n\r\n# if using JNDI:  connection factory name to lookup\r\ngg.jmshandler.connectionfactory=ConnectionFactory\r\n\r\n# if NOT using JNDI: connection info\r\ngg.jmshandler.connection.factoryclass=org.apache.activemq.ActiveMQConnectionFactory\r\n#gg.jmshandler.connection.url=tcp:\/\/localhost:61616\r\ngg.jmshandler.connection.url=tcp:\/\/localhost:61616?jms.useAsyncSend=true\r\n\r\ngg.jmshandler.timetolive=50000\r\n# gg.jmshandler.priority \u00c2\u00ad JMS Priority\r\n# gg.jmshandler.retry.times - JMS Retry Times\r\n# gg.jmshandler.retry.initdelay - JMS Retry Init Delay MS\r\n# gg.jmshandler.retry.expdelay=[true, false] - JMS Retry Exponential Delay\r\n# gg.jmshandler.connection.url - JMS Url\r\n# gg.jmshandler.connectionfactory - JMS Connection Factory Name\r\n# gg.jmshandler.jndi.properties \u00e2\u20ac\u201c Context Properties\r\n# gg.jmshandler.usejndi=[true, false] - JMS Use JNDI\r\n\r\n\r\n# ==========================================================\r\n# The rest of the properties are standard JNDI properties\r\n# passed directly to the IntialContext (used when usejndi=true)\r\n# See the ActiveMQ & JMS documentation for settings.\r\n\r\njava.naming.provider.url=tcp:\/\/localhost:61616\r\n\r\n# embedded broker, eg: \r\n#  java.naming.provider.url=vm:broker:(tcp:\/\/localhost:61616)\r\n#  java.naming.provider.url=vm:\/\/localhost\r\n\r\n# topics can be registered in JNDI using the form\r\n# topic.[jndiName] = [physicalName]\r\n# topic.MyTopic = example.MyTopic\r\n#   Then the topic can be looked up using \"MyTopic\".\r\n#   The prefix topic\/queue is stripped, so the jndi name begins after the prefix.\r\n\r\njava.naming.factory.url.pkgs=org.apache.activemq.jndi\r\njava.naming.factory.initial=org.apache.activemq.jndi.ActiveMQInitialContextFactory\r\n\r\n#  java.naming.security.principal=my_jndi_username \r\n#  java.naming.security.credentials=my_jndi_password\r\n<\/pre>\n<p>* Copy &#8216;activemq.properties&#8217; to dirprm directory.<\/p>\n<span id=\"Insert_Data_to_Source_Table\"><h3>Insert Data to Source Table<\/h3><\/span>\n<pre lang=\"sql\">\r\ninsert into GG_SRC.gg_test values ('100','One Hundred');\r\ncommit;\r\n<\/pre>\n<span id=\"Check_output.txt\"><h3>Check output.txt<\/h3><\/span>\n<pre lang=\"bash\">\r\nTransaction: numOps=1 (buffer=1) ts='2010-05-08 03:14:28.000000' \r\n Operation (seq=3\/rba=1525 [W]): INSERT (INSERT) on table \"GG_SRC.GG_TEST\":\r\n    GG_SRC.GG_TEST, (key=true) ID = \"100\"\r\n    GG_SRC.GG_TEST, (key=false) NAME = \"One Hundred\"\r\n<\/pre>\n<span id=\"Check_ActiveMQ_Queue\"><h3>Check ActiveMQ Queue<\/h3><\/span>\n<pre lang=\"xml\">\r\n<operation table='GG_SRC.GG_TEST' type='INSERT' ts='2010-05-08 03:14:28.000000' pos='00000000030000001525' numCols='2'>\r\n <col name='ID' index='0'>\r\n   <before missing='true'\/>\r\n   <after><![CDATA[100]]><\/after>\r\n <\/col>\r\n <col name='NAME' index='1'>\r\n   <before missing='true'\/>\r\n   <after><![CDATA[One Hundred]]><\/after>\r\n <\/col>\r\n<\/operation><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Prepare GoldenGate, Database, Extract Process * See this post to setup GoldenGate and database. Install Java Adapter * See this post to setup GoldenGate Java Adapter. Overview * Install ActiveMQ * Create Data Pump * Edit Params to point to &hellip; <a href=\"https:\/\/jianmingli.com\/wp\/?p=1697\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_exactmetrics_skip_tracking":false,"_exactmetrics_sitenote_active":false,"_exactmetrics_sitenote_note":"","_exactmetrics_sitenote_category":0,"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[88],"tags":[],"class_list":["post-1697","post","type-post","status-publish","format-standard","hentry","category-goldengate"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p8cRUO-rn","_links":{"self":[{"href":"https:\/\/jianmingli.com\/wp\/index.php?rest_route=\/wp\/v2\/posts\/1697","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/jianmingli.com\/wp\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/jianmingli.com\/wp\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/jianmingli.com\/wp\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/jianmingli.com\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1697"}],"version-history":[{"count":2,"href":"https:\/\/jianmingli.com\/wp\/index.php?rest_route=\/wp\/v2\/posts\/1697\/revisions"}],"predecessor-version":[{"id":1950,"href":"https:\/\/jianmingli.com\/wp\/index.php?rest_route=\/wp\/v2\/posts\/1697\/revisions\/1950"}],"wp:attachment":[{"href":"https:\/\/jianmingli.com\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1697"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jianmingli.com\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1697"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jianmingli.com\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1697"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}