{"id":2621,"date":"2010-11-17T14:31:53","date_gmt":"2010-11-17T13:31:53","guid":{"rendered":"http:\/\/blog.jteam.nl\/?p=2621"},"modified":"2010-11-17T14:31:53","modified_gmt":"2010-11-17T13:31:53","slug":"migrating-from-spring-integration-1-0-3-to-2-0-0-rc2","status":"publish","type":"post","link":"https:\/\/trifork.nl\/blog\/migrating-from-spring-integration-1-0-3-to-2-0-0-rc2\/","title":{"rendered":"Migrating from Spring Integration 1.0.3 to 2.0.0.RC2"},"content":{"rendered":"<p>Spring Integration 2.0.0.RC2 is out and I really wanted to upgrade in my current project. Few of the reasons to upgrade were the dependency of Spring 3 and the support for JMX. Because SpringSource changed a few things in the 2.0.0 release, I want to share the steps I had to take and issues that I solve to migrate from Spring Integration 1.0.3 to the latest version 2.0.0.<\/p>\n<p><!--more--><\/p>\n<h2>Maven<\/h2>\n<p>The first thing to do is, how surprising, upgrading your dependency. I use Maven so for me it is as simple as changing the version to 2.0.0.RC2.<\/p>\n<pre><pre class=\"brush: xml; title: ; notranslate\" title=\"\">\n&lt;dependency&gt;\n    &lt;groupid&gt;org.springframework.integration&lt;\/groupid&gt;\n    &lt;artifactid&gt;spring-integration-XXXX&lt;\/artifactid&gt;\n    &lt;version&gt;2.0.0.RC2&lt;\/version&gt;\n&lt;\/dependency&gt;\n<\/pre>\n<h2>Package structure changes<\/h2>\n<p>One of the first things that you will notice is that your Spring Integration project does not compile anymore <img decoding=\"async\" class=\"wlEmoticon wlEmoticon-smile\" style=\"border-style: none\" src=\"http:\/\/blog.jteam.nl\/wp-content\/uploads\/2010\/11\/wlEmoticon-smile.png\" alt=\"Glimlach\" \/>, because they have moved some classes. All classes from the <tt>org.springframework.integration.core<\/tt> package have moved to <tt>org.springframework.integration<\/tt>. This package contains the now the often used classes like <tt>Message.java<\/tt> and <tt>MessageChannel.java<\/tt>.<\/p>\n<p>Another class that I use quite often is the <tt>MessageBuilder.java<\/tt>. This class moved from the <span style=\"font-family: Courier New\">message<\/span> to the <span style=\"font-family: Courier New\">support<\/span> package. The <span style=\"font-family: Courier New\">message<\/span> package now only holds two messages classes, <span style=\"font-family: Courier New\">ErrorMessage.java<\/span> and <span style=\"font-family: Courier New\">GenericMessage.java<\/span>.<\/p>\n<p>I can see you thinking.. where is the <span style=\"font-family: Courier New\">StringMessage.java<\/span> class gone to? Well, they have removed it.<\/p>\n<h2>Removed classes and methods<\/h2>\n<h3>StringMessage<\/h3>\n<p>I have used the StringMessage class a few times in my project, but couldn\u2019t find it anymore after the upgrade. So I looked in Jira and found <a href=\"https:\/\/jira.springsource.org\/browse\/INT-1389\" target=\"_blank\" rel=\"noopener\">this issue<\/a>. StringMessage is gone, but you can easily refactor your code to one of the following options:<\/p>\n<pre><pre class=\"brush: java; title: ; notranslate\" title=\"\">\nMessage&lt;String&gt; stringMessage1 = new GenericMessage&lt;String&gt;(&quot;one&quot;);\n\nMessage&lt;String&gt; stringMessage2 = MessageBuilder.withPayload(&quot;two&quot;).build();\n<\/pre>\n<h3>MessageChannel.getName()<\/h3>\n<p>In one of my routers called the method <span style=\"font-family: Courier New\">MessageChannel.getName()<\/span> to route the message to the correct message channel. Unfortunately for me, they removed the method from the interface. To solve this problem I send the message directly to the channel instead of returning the name of the channel.<\/p>\n<h3>QueueChannel<\/h3>\n<p>When you use the <span style=\"font-family: Courier New\">QueueChannel.getMessageCount()<\/span> method, you will notice that it is no longer there. Well it is, but under a different name. You can use the <span style=\"font-family: Courier New\">getQueueSize()<\/span> method instead, which is just a renamed method with the same implementation.<\/p>\n<h2>Configuration changes<\/h2>\n<h3>Poller<\/h3>\n<p>In my project I use a poller for retrieving messages. In Spring Integration 1.0.3 you would configure a poller like this:<\/p>\n<pre><pre class=\"brush: xml; title: ; notranslate\" title=\"\">\n&lt;si:poller max-messages-per-poll=&quot;1&quot;&gt;\n\t&lt;si:interval-trigger time-unit=&quot;SECONDS&quot; interval=&quot;90&quot;\/&gt;\n&lt;\/si:poller&gt;\n<\/pre>\n<p>As you can see, you could specify a time unit. In SI 2.0.0.RC2 this is changed in the following code:<\/p>\n<pre><pre class=\"brush: xml; title: ; notranslate\" title=\"\">\n&lt;si:poller max-messages-per-poll=&quot;1&quot; fixed-delay=&quot;90000&quot;\/&gt;\n<\/pre>\n<p>In the new version of the poller, the <span style=\"font-family: Courier New\">interval-trigger<\/span> and <span style=\"font-family: Courier New\">cron-trigger<\/span> have been deprecated. They will be removed in 2.1. The &#8216;<span style=\"font-family: Courier New\">fixed-delay<\/span>&#8216;, &#8216;<span style=\"font-family: Courier New\">fixed-rate<\/span>&#8216;, &#8216;<span style=\"font-family: Courier New\">cron<\/span>&#8216;, or &#8216;<span style=\"font-family: Courier New\">trigger<\/span>&#8216; attributes should now be used instead. With the new attributes also comes the removal of the <span style=\"font-family: Courier New\">time-unit<\/span> of the attribute. The default time-unit is now milliseconds, so don\u2019t forget to update your properties.<\/p>\n<h2>Try a Milestone release!<\/h2>\n<p>Before we upgraded to the latest version of Spring Integration we already tried to upgrade with a milestone release (2.0.0.M7). The fun thing about trying a milestone release is that you prepare yourself for the changes and get a good indication about the amount of work that the upgrade requires.<\/p>\n<p>Another cool thing is that you can help the community to check for bugs or suggest an improvement. During our milestone upgrade my colleague Jettro Coenradie and I found a <a href=\"https:\/\/jira.springsource.org\/browse\/INT-1442\" target=\"_blank\" rel=\"noopener\">bug<\/a> in the splitter element. So we reported it and now it is fixed in the current release and made the software world a little better <img decoding=\"async\" class=\"wlEmoticon wlEmoticon-smile\" style=\"border-style: none\" src=\"http:\/\/blog.jteam.nl\/wp-content\/uploads\/2010\/11\/wlEmoticon-smile.png\" alt=\"Glimlach\" \/>.<\/p>\n<h2>Full Migration Guide<\/h2>\n<p>SpringSource will probably publish a full migration guide by the time version 2.0.0 is finished. In the meantime I hope that my post was any helpful during your own migration.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Spring Integration 2.0.0.RC2 is out and I really wanted to upgrade in my current project. Few of the reasons to upgrade were the dependency of Spring 3 and the support for JMX. Because SpringSource changed a few things in the 2.0.0 release, I want to share the steps I had to take and issues that [&hellip;]<\/p>\n","protected":false},"author":102,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"content-type":"","footnotes":""},"categories":[10],"tags":[190,214],"class_list":["post-2621","post","type-post","status-publish","format-standard","hentry","category-development","tag-spring-integration","tag-upgrade"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v24.4 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Migrating from Spring Integration 1.0.3 to 2.0.0.RC2 - Trifork Blog<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/trifork.nl\/blog\/migrating-from-spring-integration-1-0-3-to-2-0-0-rc2\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Migrating from Spring Integration 1.0.3 to 2.0.0.RC2 - Trifork Blog\" \/>\n<meta property=\"og:description\" content=\"Spring Integration 2.0.0.RC2 is out and I really wanted to upgrade in my current project. Few of the reasons to upgrade were the dependency of Spring 3 and the support for JMX. Because SpringSource changed a few things in the 2.0.0 release, I want to share the steps I had to take and issues that [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/trifork.nl\/blog\/migrating-from-spring-integration-1-0-3-to-2-0-0-rc2\/\" \/>\n<meta property=\"og:site_name\" content=\"Trifork Blog\" \/>\n<meta property=\"article:published_time\" content=\"2010-11-17T13:31:53+00:00\" \/>\n<meta property=\"og:image\" content=\"http:\/\/blog.jteam.nl\/wp-content\/uploads\/2010\/11\/wlEmoticon-smile.png\" \/>\n<meta name=\"author\" content=\"Roberto van der Linden\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Roberto van der Linden\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/trifork.nl\/blog\/migrating-from-spring-integration-1-0-3-to-2-0-0-rc2\/\",\"url\":\"https:\/\/trifork.nl\/blog\/migrating-from-spring-integration-1-0-3-to-2-0-0-rc2\/\",\"name\":\"Migrating from Spring Integration 1.0.3 to 2.0.0.RC2 - Trifork Blog\",\"isPartOf\":{\"@id\":\"https:\/\/trifork.nl\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/trifork.nl\/blog\/migrating-from-spring-integration-1-0-3-to-2-0-0-rc2\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/trifork.nl\/blog\/migrating-from-spring-integration-1-0-3-to-2-0-0-rc2\/#primaryimage\"},\"thumbnailUrl\":\"http:\/\/blog.jteam.nl\/wp-content\/uploads\/2010\/11\/wlEmoticon-smile.png\",\"datePublished\":\"2010-11-17T13:31:53+00:00\",\"author\":{\"@id\":\"https:\/\/trifork.nl\/blog\/#\/schema\/person\/037974cf3e24a7b09a93770b190d6e35\"},\"breadcrumb\":{\"@id\":\"https:\/\/trifork.nl\/blog\/migrating-from-spring-integration-1-0-3-to-2-0-0-rc2\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/trifork.nl\/blog\/migrating-from-spring-integration-1-0-3-to-2-0-0-rc2\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/trifork.nl\/blog\/migrating-from-spring-integration-1-0-3-to-2-0-0-rc2\/#primaryimage\",\"url\":\"http:\/\/blog.jteam.nl\/wp-content\/uploads\/2010\/11\/wlEmoticon-smile.png\",\"contentUrl\":\"http:\/\/blog.jteam.nl\/wp-content\/uploads\/2010\/11\/wlEmoticon-smile.png\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/trifork.nl\/blog\/migrating-from-spring-integration-1-0-3-to-2-0-0-rc2\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/trifork.nl\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Migrating from Spring Integration 1.0.3 to 2.0.0.RC2\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/trifork.nl\/blog\/#website\",\"url\":\"https:\/\/trifork.nl\/blog\/\",\"name\":\"Trifork Blog\",\"description\":\"Keep updated on the technical solutions Trifork is working on!\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/trifork.nl\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/trifork.nl\/blog\/#\/schema\/person\/037974cf3e24a7b09a93770b190d6e35\",\"name\":\"Roberto van der Linden\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/trifork.nl\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/afe49faf7ef8dd3753baefb334568b10?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/afe49faf7ef8dd3753baefb334568b10?s=96&d=mm&r=g\",\"caption\":\"Roberto van der Linden\"},\"url\":\"https:\/\/trifork.nl\/blog\/author\/roberto\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Migrating from Spring Integration 1.0.3 to 2.0.0.RC2 - Trifork Blog","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/trifork.nl\/blog\/migrating-from-spring-integration-1-0-3-to-2-0-0-rc2\/","og_locale":"en_US","og_type":"article","og_title":"Migrating from Spring Integration 1.0.3 to 2.0.0.RC2 - Trifork Blog","og_description":"Spring Integration 2.0.0.RC2 is out and I really wanted to upgrade in my current project. Few of the reasons to upgrade were the dependency of Spring 3 and the support for JMX. Because SpringSource changed a few things in the 2.0.0 release, I want to share the steps I had to take and issues that [&hellip;]","og_url":"https:\/\/trifork.nl\/blog\/migrating-from-spring-integration-1-0-3-to-2-0-0-rc2\/","og_site_name":"Trifork Blog","article_published_time":"2010-11-17T13:31:53+00:00","og_image":[{"url":"http:\/\/blog.jteam.nl\/wp-content\/uploads\/2010\/11\/wlEmoticon-smile.png","type":"","width":"","height":""}],"author":"Roberto van der Linden","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Roberto van der Linden","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/trifork.nl\/blog\/migrating-from-spring-integration-1-0-3-to-2-0-0-rc2\/","url":"https:\/\/trifork.nl\/blog\/migrating-from-spring-integration-1-0-3-to-2-0-0-rc2\/","name":"Migrating from Spring Integration 1.0.3 to 2.0.0.RC2 - Trifork Blog","isPartOf":{"@id":"https:\/\/trifork.nl\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/trifork.nl\/blog\/migrating-from-spring-integration-1-0-3-to-2-0-0-rc2\/#primaryimage"},"image":{"@id":"https:\/\/trifork.nl\/blog\/migrating-from-spring-integration-1-0-3-to-2-0-0-rc2\/#primaryimage"},"thumbnailUrl":"http:\/\/blog.jteam.nl\/wp-content\/uploads\/2010\/11\/wlEmoticon-smile.png","datePublished":"2010-11-17T13:31:53+00:00","author":{"@id":"https:\/\/trifork.nl\/blog\/#\/schema\/person\/037974cf3e24a7b09a93770b190d6e35"},"breadcrumb":{"@id":"https:\/\/trifork.nl\/blog\/migrating-from-spring-integration-1-0-3-to-2-0-0-rc2\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/trifork.nl\/blog\/migrating-from-spring-integration-1-0-3-to-2-0-0-rc2\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/trifork.nl\/blog\/migrating-from-spring-integration-1-0-3-to-2-0-0-rc2\/#primaryimage","url":"http:\/\/blog.jteam.nl\/wp-content\/uploads\/2010\/11\/wlEmoticon-smile.png","contentUrl":"http:\/\/blog.jteam.nl\/wp-content\/uploads\/2010\/11\/wlEmoticon-smile.png"},{"@type":"BreadcrumbList","@id":"https:\/\/trifork.nl\/blog\/migrating-from-spring-integration-1-0-3-to-2-0-0-rc2\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/trifork.nl\/blog\/"},{"@type":"ListItem","position":2,"name":"Migrating from Spring Integration 1.0.3 to 2.0.0.RC2"}]},{"@type":"WebSite","@id":"https:\/\/trifork.nl\/blog\/#website","url":"https:\/\/trifork.nl\/blog\/","name":"Trifork Blog","description":"Keep updated on the technical solutions Trifork is working on!","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/trifork.nl\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/trifork.nl\/blog\/#\/schema\/person\/037974cf3e24a7b09a93770b190d6e35","name":"Roberto van der Linden","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/trifork.nl\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/afe49faf7ef8dd3753baefb334568b10?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/afe49faf7ef8dd3753baefb334568b10?s=96&d=mm&r=g","caption":"Roberto van der Linden"},"url":"https:\/\/trifork.nl\/blog\/author\/roberto\/"}]}},"_links":{"self":[{"href":"https:\/\/trifork.nl\/blog\/wp-json\/wp\/v2\/posts\/2621","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/trifork.nl\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/trifork.nl\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/trifork.nl\/blog\/wp-json\/wp\/v2\/users\/102"}],"replies":[{"embeddable":true,"href":"https:\/\/trifork.nl\/blog\/wp-json\/wp\/v2\/comments?post=2621"}],"version-history":[{"count":0,"href":"https:\/\/trifork.nl\/blog\/wp-json\/wp\/v2\/posts\/2621\/revisions"}],"wp:attachment":[{"href":"https:\/\/trifork.nl\/blog\/wp-json\/wp\/v2\/media?parent=2621"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/trifork.nl\/blog\/wp-json\/wp\/v2\/categories?post=2621"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/trifork.nl\/blog\/wp-json\/wp\/v2\/tags?post=2621"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}