{"id":60,"date":"2006-07-14T21:31:46","date_gmt":"2006-07-14T20:31:46","guid":{"rendered":"http:\/\/blog.pczone.be\/?p=60"},"modified":"2006-07-19T16:23:18","modified_gmt":"2006-07-19T15:23:18","slug":"first-jabber-poc","status":"publish","type":"post","link":"https:\/\/blog.pczone.be\/?p=60","title":{"rendered":"First Jabber POC"},"content":{"rendered":"<p>On my current project I see some real future into messaging. I had some intensive discussions with my manager as he is more pro SOAP webservices then into messaging. But when you have push and pull mechanisms SOAP really isn&#8217;t the answer, what would you do? setup 2 SOAP services and let them communicate?? Well what if the specs change and a third party joins in? recode everything and if bla = true connect to X, else connect to Y? Really not!!!<br \/>\nWhat you can do is place a Queue where you publish everything on. You can use Jboss 4, it has one build in or if you want to go further you could use the Jabber protocol (same as google talk if I&#8217;m not mistaken). I have a jabber running on my server and did a very small test in java. I used the <a href=\"http:\/\/www.jivesoftware.org\/smack\/\">smack library<\/a>, a small native java library. And I wrote this stupid little expample<\/p>\n<pre>\r\npublic static void main(String[] args){\r\n\t\ttry {\r\n\t\t\tXMPPConnection.DEBUG_ENABLED = true;\r\n\t\t\tSSLXMPPConnection.DEBUG_ENABLED = true;\r\n\t\t\tXMPPConnection con = new XMPPConnection(\"pczone.be\",5222);\r\n\t\t\tcon.login(\"xxx\", \"xxx\");\r\n\t\t\tcon.createChat(\"me\").sendMessage(\"hello\");\r\n\t\t\tPacketFilter filter = new PacketTypeFilter(Message.class);\r\n\t\t\tPacketCollector myCollector = con.createPacketCollector(filter);\r\n\t\t\t\r\n\t\t\tPacketListener myListener = new PacketListener(){\r\n\t\t\t\tpublic void processPacket(Packet pac){\r\n\t\t\t\t\tSystem.out.println(pac.toString());\r\n\t\t\t\t}\r\n\t\t\t};\r\n\t\t\tcon.addPacketListener(myListener,filter);\r\n\t\t} catch (Exception e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n}\r\n<\/pre>\n<p>What this stupid little example did was simply logon to my server, send me a message and listen for incoming messages. I ran this in debugmode with a breakpoint on the System.out.println line, when I replied to my message my breakpoint worked. I could inspect the message and see somewhere in the body my content wrapped in a jabber xml.<\/p>\n<p>Off course it&#8217;s no rocket science, but it&#8217;s always nice when you see something spectaculair. \ud83d\ude42<\/p>\n<p>I&#8217;ll certainly use this in future projects. How exactly, hmm not yet sure \ud83d\ude42<\/p>\n","protected":false},"excerpt":{"rendered":"<p>On my current project I see some real future into messaging. I had some intensive discussions with my manager as he is more pro SOAP webservices then into messaging. But when you have push and pull mechanisms SOAP really isn&#8217;t the answer, what would you do? setup 2 SOAP services and let them communicate?? Well &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/blog.pczone.be\/?p=60\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;First Jabber POC&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"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,"enabled":false},"version":2}},"categories":[4],"tags":[],"class_list":["post-60","post","type-post","status-publish","format-standard","hentry","category-informatics"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p3U9nk-Y","jetpack_sharing_enabled":true,"jetpack_likes_enabled":true,"jetpack-related-posts":[],"_links":{"self":[{"href":"https:\/\/blog.pczone.be\/index.php?rest_route=\/wp\/v2\/posts\/60","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.pczone.be\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.pczone.be\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.pczone.be\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.pczone.be\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=60"}],"version-history":[{"count":0,"href":"https:\/\/blog.pczone.be\/index.php?rest_route=\/wp\/v2\/posts\/60\/revisions"}],"wp:attachment":[{"href":"https:\/\/blog.pczone.be\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=60"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.pczone.be\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=60"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.pczone.be\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=60"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}