<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>JMS &#8211; My Shitty Code</title>
	<atom:link href="https://myshittycode.com/tag/jms/feed/" rel="self" type="application/rss+xml" />
	<link>https://myshittycode.com</link>
	<description>Embracing the Messiness in Search of Epic Solutions</description>
	<lastBuildDate>Fri, 06 Jan 2023 16:16:10 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.1</generator>

<image>
	<url>https://myshittycode.com/wp-content/uploads/2022/04/cropped-icon-32x32.png</url>
	<title>JMS &#8211; My Shitty Code</title>
	<link>https://myshittycode.com</link>
	<width>32</width>
	<height>32</height>
</image> 
<site xmlns="com-wordpress:feed-additions:1">205304208</site>	<item>
		<title>Spring Boot: Connecting to IBM MQ over JMS using non-IBM JRE</title>
		<link>https://myshittycode.com/2019/04/23/spring-boot-connecting-to-ibm-mq-over-jms-using-non-ibm-jre/</link>
					<comments>https://myshittycode.com/2019/04/23/spring-boot-connecting-to-ibm-mq-over-jms-using-non-ibm-jre/#comments</comments>
		
		<dc:creator><![CDATA[Shitty Author]]></dc:creator>
		<pubDate>Wed, 24 Apr 2019 01:44:44 +0000</pubDate>
				<category><![CDATA[Programming Language]]></category>
		<category><![CDATA[Server]]></category>
		<category><![CDATA[IBM MQ]]></category>
		<category><![CDATA[JMS]]></category>
		<category><![CDATA[Spring Boot]]></category>
		<guid isPermaLink="false">http://myshittycode.com/?p=1092</guid>

					<description><![CDATA[<p>There are several ways to connect to IBM MQ:- This article shows you how to connect with Spring&#8217;s JmsTemplate. CONNECTIVITY INFO Typically, the MQ admin will provide the following connectivity info that allows you to connect to MQ:- DEPENDENCY Add the following dependency:- SPRING CONFIGURATION While the connectivity info can be hardcoded in Spring Boot&#8217;s [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://myshittycode.com/2019/04/23/spring-boot-connecting-to-ibm-mq-over-jms-using-non-ibm-jre/">Spring Boot: Connecting to IBM MQ over JMS using non-IBM JRE</a> appeared first on <a rel="nofollow" href="https://myshittycode.com">My Shitty Code</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>There are several ways to connect to IBM MQ:-</p>



<ul class="wp-block-list">
<li><code>com.ibm.mq.MQQueueManager</code></li>



<li><code>com.ibm.mq.jms.MQQueueConnectionFactory</code></li>



<li><code>com.ibm.msg.client.jms.JmsConnectionFactory</code></li>
</ul>



<p>This article shows you how to connect with Spring&#8217;s <code>JmsTemplate</code>.</p>



<h2 class="wp-block-heading">CONNECTIVITY INFO</h2>



<p>Typically, the MQ admin will provide the following connectivity info that allows you to connect to MQ:-</p>



<ul class="wp-block-list">
<li>Queue manager name, ex: <code>MY.QUEUE.MANAGER</code></li>



<li>Host name, ex: <code>server.com</code></li>



<li>Port, ex: <code>1415</code></li>



<li>Channel name, ex: <code>MY.SSL.CHANNEL</code></li>



<li>SSL Cipher Suite, ex: <code>SSL_ECDHE_RSA_WITH_AES_128_GCM_SHA256</code></li>



<li>User, ex: <code>user</code></li>



<li>Password, ex: <code>password</code></li>



<li>Queue name, ex: <code>MY.QUEUE</code></li>
</ul>



<h2 class="wp-block-heading">DEPENDENCY</h2>



<p>Add the following dependency:-</p>


<div class="wp-block-syntaxhighlighter-code "><pre class="brush: plain; title: ; notranslate">
dependencies {
  compile &#039;com.ibm.mq:mq-jms-spring-boot-starter:2.1.1&#039;
}
</pre></div>


<h2 class="wp-block-heading">SPRING CONFIGURATION</h2>



<p>While the connectivity info can be hardcoded in Spring Boot&#8217;s <code>application.properties</code>, it&#8217;s probably more logical to use Spring <code>@Configuration</code> to dynamically set the values especially dealing with credential.</p>



<p>So, create a Spring configuration that looks something like this:-</p>


<div class="wp-block-syntaxhighlighter-code "><pre class="brush: groovy; title: ; notranslate">
// while all the value are hardcoded here for simplicity sake, you can inject
// sensitive values from DB, through &lt;code&gt;Environment&lt;/code&gt;, etc.
@EnableJms
@Configuration
class JmsConfig {
  // Adding @Primary will force Spring Boot to use this bean
  // instead of the one provided by the dependency
  @Primary
  @Bean
  MQConfigurationProperties mqConfigurationProperties() {
    System.setProperty(&#039;javax.net.ssl.keyStore&#039;, &#039;/path/to/keystore.jks&#039;)
    System.setProperty(&#039;javax.net.ssl.keyStorePassword&#039;, &#039;XXXXXXX&#039;)

    return new MQConfigurationProperties(
      queueManager: &#039;MY.QUEUE.MANAGER&#039;,
      channel: &#039;MY.SSL.CHANNEL&#039;,
      connName: &#039;server.com(1415)&#039;,
      user: &#039;user&#039;,
      password: &#039;password&#039;,
      userAuthenticationMQCSP: true,

      // If the provided SSL cipher suite begins with &quot;SSL&quot;,
      // replace it with &quot;TLS&quot; instead.
      // SSL_* is IBM JRE CipherSuite name.
      // TLS_* is Oracle JRE CipherSuite name.
      sslCipherSuite: &#039;TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256&#039;,

      // true - if using IBM JRE
      // false - if using non-IBM JRE, ex: Oracle, OpenJDK, etc
      useIBMCipherMappings: false
    )
  }
}
</pre></div>


<h2 class="wp-block-heading">USING JMS TEMPLATE</h2>



<p>Finally, to listen to the given queue, it is as easy as autowiring <code>JmsTemplate</code> and start using it.</p>


<div class="wp-block-syntaxhighlighter-code "><pre class="brush: groovy; title: ; notranslate">
@Autowired
JmsTemplate jmsTemplate

...

final Message message = jmsTemplate.receive(&#039;MY.QUEUE&#039;)
println message
</pre></div><p>The post <a rel="nofollow" href="https://myshittycode.com/2019/04/23/spring-boot-connecting-to-ibm-mq-over-jms-using-non-ibm-jre/">Spring Boot: Connecting to IBM MQ over JMS using non-IBM JRE</a> appeared first on <a rel="nofollow" href="https://myshittycode.com">My Shitty Code</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://myshittycode.com/2019/04/23/spring-boot-connecting-to-ibm-mq-over-jms-using-non-ibm-jre/feed/</wfw:commentRss>
			<slash:comments>3</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">1092</post-id>	</item>
	</channel>
</rss>

<!--
Performance optimized by W3 Total Cache. Learn more: https://www.boldgrid.com/w3-total-cache/?utm_source=w3tc&utm_medium=footer_comment&utm_campaign=free_plugin

Page Caching using Disk: Enhanced 
Lazy Loading (feed)
Database Caching 52/67 queries in 0.044 seconds using Disk

Served from: myshittycode.com @ 2026-02-20 12:54:41 by W3 Total Cache
-->