{"id":5493,"date":"2016-05-18T18:14:54","date_gmt":"2016-05-18T23:14:54","guid":{"rendered":"http:\/\/appcrawler.com\/wordpress\/?p=5493"},"modified":"2016-05-18T18:14:54","modified_gmt":"2016-05-18T23:14:54","slug":"where-does-activemq-store-subscriber-information","status":"publish","type":"post","link":"http:\/\/appcrawler.com\/wordpress\/2016\/05\/18\/where-does-activemq-store-subscriber-information\/","title":{"rendered":"Where does ActiveMQ store subscriber information?"},"content":{"rendered":"<p>After subscribing, you will see an entry in the ACTIVEMQ_ACKS table&#8230;<\/p>\n<pre>\r\nSQL> select container,client_id from esb.activemq_acks;\r\n\r\nCONTAINER                                CLIENT_ID\r\n---------------------------------------- ----------------------------------------\r\ntopic:\/\/testTopic                        me\r\ntopic:\/\/testTopic                        mysubscriber\r\ntopic:\/\/testTopic                        mysubscriber2\r\n\r\nSQL>\r\n<\/pre>\n<p>Once unsubscribe has been run on the subscriber&#8230;<\/p>\n<pre>\r\n    ConnectionFactory connectionFactory=new ActiveMQConnectionFactory(\"admin\", \"admin\", \"tcp:\/\/localhost:61616\");\r\n    Connection connection = connectionFactory.createConnection();\r\n    connection.setClientID(args[0]);\r\n    connection.start();\r\n    Session session = connection.createSession(false,Session.AUTO_ACKNOWLEDGE);\r\n    if (args[1].equals(\"unsubscribe\")) {\r\n      session.unsubscribe(\"testTopic\");\r\n      System.out.println(\"unsubscribed\");\r\n      System.exit(0);\r\n    }\r\n<\/pre>\n<p>&#8230;you will no longer see an entry in the ACTIVEMQ_ACKS table&#8230;<\/p>\n<pre>\r\nSQL> select container,client_id from esb.activemq_acks\r\n\r\nCONTAINER                                CLIENT_ID\r\n---------------------------------------- ----------------------------------------\r\ntopic:\/\/testTopic                        mysubscriber\r\ntopic:\/\/testTopic                        mysubscriber2\r\n\r\nSQL>\r\n<\/pre>\n<p>A database trace will show what is below&#8230;<\/p>\n<pre>\r\n#-------------------------------------------------------------------\r\n2016-05-18 19:03:01.327785\r\n12280 milliseconds since the previous top level execution statement.\r\nLINE# =  1381\r\nDELETE FROM ACTIVEMQ_ACKS WHERE CONTAINER=:1  AND CLIENT_ID=:2  AND SUB_NAME=:3\r\n\r\n  select obj#, name, stab#, sobj#, sobjd#, ttab#, tobj#, tobjd#, mflags from rmtab$ where (stab# = :1 or ttab# = :1) order by obj#\r\n\r\n  select binaryDefVal, lengthb(binaryDefVal), guard_id from ecol$ where tabobj# = :1 and colnum = :2\r\n\r\n#-------------------------------------------------------------------\r\n2016-05-18 19:03:01.336822\r\n9 milliseconds since the previous top level execution statement.\r\nLINE# =  1404\r\nSELECT COUNT(*) FROM ACTIVEMQ_MSGS M, ACTIVEMQ_ACKS D  WHERE D.CONTAINER=:1  AND D.CLIENT_ID=:2  AND D.SUB_NAME=:3  AND M.CONTAINER=D.CONTAINER      AND M.ID >          ( SELECT LAST_ACKED_ID FROM ACTIVEMQ_ACKS           WHERE CONTAINER=D.CONTAINER AND CLIENT_ID=D.CLIENT_ID           AND SUB_NAME=D.SUB_NAME )\r\n\r\n#-------------------------------------------------------------------\r\n<\/pre>\n<p>&#8230;with the following for bind variable values when the backing store is an Oracle database&#8230;<\/p>\n<pre>\r\nBINDS #139635352651880:\r\n Bind#0\r\n  oacdty=01 mxl=128(68) mxlc=00 mal=00 scl=00 pre=00\r\n  oacflg=03 fl2=1000010 frm=01 csi=873 siz=288 off=0\r\n  kxsbbbfp=7eff63981148  bln=128  avl=17  flg=05\r\n  value=\"topic:\/\/testTopic\"\r\n Bind#1\r\n  oacdty=01 mxl=32(08) mxlc=00 mal=00 scl=00 pre=00\r\n  oacflg=03 fl2=1000010 frm=01 csi=873 siz=0 off=128\r\n  kxsbbbfp=7eff639811c8  bln=32  avl=02  flg=01\r\n  value=\"me\"\r\n Bind#2\r\n  oacdty=01 mxl=128(36) mxlc=00 mal=00 scl=00 pre=00\r\n  oacflg=03 fl2=1000010 frm=01 csi=873 siz=0 off=160\r\n  kxsbbbfp=7eff639811e8  bln=128  avl=09  flg=01\r\n  value=\"testTopic\"\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>After subscribing, you will see an entry in the ACTIVEMQ_ACKS table&#8230; SQL> select container,client_id from esb.activemq_acks; CONTAINER CLIENT_ID &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;- &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;- topic:\/\/testTopic me topic:\/\/testTopic mysubscriber topic:\/\/testTopic mysubscriber2 SQL> Once unsubscribe has been run on the subscriber&#8230; ConnectionFactory connectionFactory=new ActiveMQConnectionFactory(&#8220;admin&#8221;, &#8220;admin&#8221;, &#8220;tcp:\/\/localhost:61616&#8221;);&hellip;<\/p>\n<p class=\"more-link-p\"><a class=\"more-link\" href=\"http:\/\/appcrawler.com\/wordpress\/2016\/05\/18\/where-does-activemq-store-subscriber-information\/\">Read more &rarr;<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_mi_skip_tracking":false,"footnotes":""},"categories":[71],"tags":[],"_links":{"self":[{"href":"http:\/\/appcrawler.com\/wordpress\/wp-json\/wp\/v2\/posts\/5493"}],"collection":[{"href":"http:\/\/appcrawler.com\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/appcrawler.com\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/appcrawler.com\/wordpress\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/appcrawler.com\/wordpress\/wp-json\/wp\/v2\/comments?post=5493"}],"version-history":[{"count":5,"href":"http:\/\/appcrawler.com\/wordpress\/wp-json\/wp\/v2\/posts\/5493\/revisions"}],"predecessor-version":[{"id":5499,"href":"http:\/\/appcrawler.com\/wordpress\/wp-json\/wp\/v2\/posts\/5493\/revisions\/5499"}],"wp:attachment":[{"href":"http:\/\/appcrawler.com\/wordpress\/wp-json\/wp\/v2\/media?parent=5493"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/appcrawler.com\/wordpress\/wp-json\/wp\/v2\/categories?post=5493"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/appcrawler.com\/wordpress\/wp-json\/wp\/v2\/tags?post=5493"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}