tag:blogger.com,1999:blog-86234362629278807432024-03-13T13:54:59.089-07:00Tech notesLet's Message and Streamhttp://www.blogger.com/profile/00059356931709697164noreply@blogger.comBlogger8125tag:blogger.com,1999:blog-8623436262927880743.post-13177951295677390572022-09-28T19:35:00.002-07:002022-09-28T19:35:17.214-07:00Let's Kafka<p><span style="font-family: courier;">I thought of documenting my Kafka learning process so one might find this helpful. </span></p><p><span style="font-family: courier;">How to start the broker:</span></p><p><span style="font-family: courier;"></span></p><blockquote><p><span style="font-family: courier;">$ ./zookeeper-server-start.sh -daemon /home/bershath/apps/kafka/kafka_2.13-3.1.0.redhat-00004/config/zookeeper.properties</span></p><p><span style="font-family: courier;">#Verify the existence of zookeeper</span></p><p><span style="font-family: courier;">$ jcmd | grep zookeeper</span></p><p><span style="font-family: courier;">$ ./kafka-server-start.sh -daemon /home/bershath/apps/kafka/kafka_2.13-3.1.0.redhat-00004/config/server.properties</span></p><p><span style="font-family: courier;">#Verify Kafka is running</span></p><p><span style="font-family: courier;">$ jcmd | grep kafka</span></p><p></p></blockquote><p><span style="font-family: courier;"><br /></span></p><p><span style="font-family: courier;">How to send a few messages and receive them to verify the installation</span></p><p><span style="font-family: courier;"></span></p><blockquote><p><span style="font-family: courier;">$ ./kafka-topics.sh --bootstrap-server localhost:9092 --create --replication-factor 1 --partitions 1 --topic test</span></p><p><span style="font-family: courier;">$ ./kafka-topics.sh --bootstrap-server localhost:9092 --describe --topic test</span></p><p><span style="font-family: courier;">$ ./kafka-console-producer.sh --bootstrap-server localhost:9092 --topic test</span></p><p><span style="font-family: courier;">$ ./kafka-console-consumer.sh --bootstrap-server localhost:9092 --topic test --from-beginning</span></p></blockquote><p><span style="font-family: courier;"></span></p><p><br /></p><p><br /></p>Let's Message and Streamhttp://www.blogger.com/profile/00059356931709697164noreply@blogger.com0tag:blogger.com,1999:blog-8623436262927880743.post-81673915932808884602018-08-07T20:32:00.002-07:002018-08-07T20:32:25.361-07:00Left blankThis page intentionally left blank to recreate JMS 2 specific content without using any confusing private APIs ;-)<br />
<br />
Thanks<br />
TyLet's Message and Streamhttp://www.blogger.com/profile/00059356931709697164noreply@blogger.com0tag:blogger.com,1999:blog-8623436262927880743.post-22300409797405996892013-11-10T07:15:00.002-08:002014-09-19T02:53:06.061-07:00Sending and receiving a message using JMS 2 API<span style="font-family: Verdana, sans-serif;"><b><u>Sending a message with JMS 2.0</u></b></span><br />
<span style="font-family: Verdana, sans-serif;">The JMS 2.0 aka simplified API has reduced the number of JMS objects required to send a message to a destination. The simplified API provides two objects for the said task, JMSProducer and JMSConsumer interfaces respectively. The good thing about them is they both allow method calls to be chained together. </span><br />
<span style="font-family: Verdana, sans-serif;"><br /></span>
<span style="font-family: Verdana, sans-serif;">Let's take a look at the sender code. </span><br />
<span style="font-family: Verdana, sans-serif;"><br /></span>
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">public void sendMessage(String messageText, String destinationAddress){</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> ResourceFactory resourceFactory = new ResourceFactoryImpl();</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> try(JMSContext jmsContext = resourceFactory.getJMSContext(JMSContext.AUTO_ACKNOWLEDGE);){</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span>Queue queue = jmsContext.createQueue(destinationAddress);</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span>jmsContext.createProducer().send(queue, messageText);</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> }</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">}</span><br />
<span style="font-family: Verdana, sans-serif;"><br /></span>
<span style="font-family: Verdana, sans-serif;"><br /></span>
<b><u><span style="font-family: Verdana, sans-serif;">A word on </span><span style="font-family: Verdana, sans-serif;">JMSContext.createQueue(String queueAddress)</span></u></b><br />
<span style="font-family: Verdana, sans-serif;">The JMSContext.createQueue(String queueAddress) would not create a physical destination but Queue object for an existing destination. It is encouraged to look up for the administrative Queue object on the JNDI namespace since this approach reduces the chances of portability of the code as we have to provide it with a vendor specific physical Queue name. </span><br />
<span style="font-family: Verdana, sans-serif;"><br /></span>
<span style="font-family: Verdana, sans-serif;">However, in this example, it's required to provide this method with the physical queue name. In HornetQ, it's the queue address name.</span><br />
<span style="font-family: Verdana, sans-serif;"><br /></span>
<span style="font-family: Verdana, sans-serif;">On a side note, the JMS API does not provide a mechanism to create permanent destinations. It's up to the JMS implementation to provide a mechanism to create permanent destination(s). This is not mandatory since JMS specification doesn't impose JMS providers to implement such a feature.</span><br />
<span style="font-family: Verdana, sans-serif;"><br /></span>
<span style="font-family: Verdana, sans-serif;">However the JMS API allows the creation of temporary destinations. The temporary destination(s) would be removed and garbage collected when the JMS Session/JMSContext associated with the temporary destination gets closed. </span><br />
<div>
<span style="font-family: Verdana, sans-serif;"><br /></span></div>
<div>
<span style="font-family: Verdana, sans-serif;"><br /></span></div>
<span style="font-family: Verdana, sans-serif;"><b><u>Receiving a message with simplified API </u></b></span><br />
<span style="font-family: Verdana, sans-serif;">The JMS receiver code is pretty simple too. One thing you would notice is the ease of obtaining the message payload using JMSConsumer.receiveBody(), without performing any typecasting as it was with the JMS 1.1 specification. Here's the receiver code :</span><br />
<span style="font-family: Verdana, sans-serif;"><br /></span>
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">public String receiveTextMessage(String destinationAddress){</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> ResourceFactory resourceFactory = new ResourceFactoryImpl();</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> try(JMSContext jmsContext = resourceFactory.getJMSContext(JMSContext.AUTO_ACKNOWLEDGE);){</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> Queue queue = jmsContext.createQueue(destinationAddress);</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> JMSConsumer jmsConsumer = jmsContext.createConsumer(queue);</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> return jmsConsumer.receiveBody(String.class);</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> } </span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">}</span><br />
<span style="font-family: Verdana, sans-serif;"><br /></span>
<span style="font-family: Verdana, sans-serif;"><br /></span>
<span style="font-family: Verdana, sans-serif;"><br /></span>
<span style="font-family: Verdana, sans-serif;">The ResourceFactory helper interface and its implementation excerpt :</span><br />
<br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">public interface ResourceFactory {</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> public ConnectionFactory getConnectionFactory();</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> public JMSContext getJMSContext(int sessionTx);</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">}</span><br />
<span style="font-family: Verdana, sans-serif;"><br /></span>
<br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">public class ResourceFactoryImpl implements ResourceFactory {</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">....</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">....</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> @Override</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> public JMSContext getJMSContext(int sessionTx) {</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> ConnectionFactory connectionFactory = getConnectionFactory();</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> JMSContext jmsContext = connectionFactory.createContext(JMSHelper.getProperty("jms.user.name"), JMSHelper.getProperty("jms.user.password"),sessionTx);</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> return jmsContext;</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> }</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">....</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">....</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">}</span>Let's Message and Streamhttp://www.blogger.com/profile/00059356931709697164noreply@blogger.com0tag:blogger.com,1999:blog-8623436262927880743.post-668355416007275462013-11-08T18:14:00.000-08:002018-10-10T16:37:31.506-07:00JMSContext in action<span style="font-family: "verdana" , sans-serif;">One of the key changes in JMS 2.0 (simplified) API is the introduction of JMSContext Interface. <b>JMSContext</b> encapsulates the functionality of both Connection and a Session. This eliminates the need to create a JMS session explicitly, thus it reduces the number of JMS objects needed to send a message. A JMSContext can be used to create JMSConsumer(s), JMSProducer(s) or more JMSContext(s) as preferred.</span><br />
<span style="font-family: "verdana" , sans-serif;"><br /></span> <span style="font-family: "verdana" , sans-serif;"><br /></span> <span style="font-family: "verdana" , sans-serif;"><b><u>Starting a JMSContext</u></b></span><br />
<span style="font-family: "verdana" , sans-serif;">With the JMS 1.1 specification, you need to start a connection to receive messages explicitly by invoking connection.start(). The connection objects are in "stopped" mode so you need to start the connection to consume messages. Please mind, you <b>*only*</b> required to start a connection if you're planning to consume messages via the created connection object, else it is <b>*not*</b> required to start a connection. </span><br />
<span style="font-family: "verdana" , sans-serif;"><br /></span>
<span style="font-family: "verdana" , sans-serif;">The JMS specification is a bit ambiguous on the "state" of the JMSContext. The specification doesn't expect JMS providers to offer a JMSContext at "started" state by default. Instead, it expects JMS providers to auto start the JMSContext at the creation of the first consumer. However, HornetQ offers a JMSContext at started state irrespective to that. You could invoke <b>JMSContext.getAutoStart()</b> to obtain the status of the context.</span><br />
<span style="font-family: "verdana" , sans-serif;"><br /></span> <span style="font-family: "verdana" , sans-serif;"><br /></span> <span style="font-family: "verdana" , sans-serif;"><b><u>Connection sharing with JMSContext (How to cache a JMSContext)</u></b></span><br />
<span style="font-family: "verdana" , sans-serif;"><a href="http://jmsrar.blogspot.com.au/2013/10/jms-connection-factories-explained.html">On my previous blog post</a>, I explained it's an anti-pattern to create a connection at each message send() when sending messages from a plain JMS client. How could that be possible with JMSContext; since it represents both, session and a connection? </span><br />
<span style="font-family: "verdana" , sans-serif;"><br /></span> <span style="font-family: "verdana" , sans-serif;">Yes, this is still doable with JMSContext on an application client. A JMSContext is not recommended to be accessed concurrently to ensure thread safety. However you could still maintain a single physical connection and share it among multiple JMS client threads by issuing each JMS client with a JMSContext. You need to invoke <b>JMSContext.createContext(int sessionMode) </b>for each JMS client; each JMSContext.createContext() invocation would not create a new physical connection but a new JMSContext. When you invoke <b>JMSContext.close()</b> on a JMSContext, it would close just the JMSContext not the physical connection if it's being used by another (active) JMSContext(s). Here's an illustration :</span><br />
<span style="font-family: "verdana" , sans-serif;"><br /></span> <span style="font-family: "courier new" , "courier" , monospace; font-size: x-small;">JMSContext jmsContext = resourceFactory.getJMSContext(JMSContext.AUTO_ACKNOWLEDGE);</span><br />
<span style="font-family: "courier new" , "courier" , monospace; font-size: x-small;">JMSContext jmsContext2 = jmsContext.createContext(0);</span><br />
<span style="font-family: "courier new" , "courier" , monospace; font-size: x-small;">JMSContext jmsContext3 = jmsContext.createContext(0);</span><br />
<span style="font-family: "courier new" , "courier" , monospace; font-size: x-small;">jmsContext.close(); </span><br />
<span style="font-family: "courier new" , "courier" , monospace; font-size: x-small;">jmsContext3.close();</span><br />
<span style="font-family: "courier new" , "courier" , monospace; font-size: x-small;">//The physical connection still active although the initial JMSContext was closed.</span><br />
<span style="font-family: "courier new" , "courier" , monospace; font-size: x-small;">Queue queue = jmsContext2.createQueue("A"); </span><br />
<span style="font-family: "courier new" , "courier" , monospace; font-size: x-small;">JMSConsumer jmsConsumer = jmsContext2.createConsumer(queue);</span><br />
<span class="Apple-tab-span" style="white-space: pre;"><span style="font-family: "verdana" , sans-serif;"> </span></span><br />
<span style="font-family: "verdana" , sans-serif;"><br /></span> <span style="font-family: "verdana" , sans-serif;"><b><u>Closing a JMSContext</u></b></span><br />
<span style="font-family: "verdana" , sans-serif;">Invoking JMSContext.close() is suffice to close a connection. The client code does *not* need to close its associated resources, such as JMS consumers and JMS producers. The JMS provider closes all the associated resources when you invoke <b>JMSContext.close()</b>.</span><br />
<span style="font-family: "verdana" , sans-serif;"><br /></span>
<br />
<span style="font-family: "verdana" , sans-serif;">The invocation of<b> JMSContext.createContext(int sessionMode)</b> is prohibited inside a JEE container as it violates JEE 7 specification. The WEB, EJB applications inside a JEE container are not allowed to have more than an active JMSContext at any given moment. The container would throw JMSRuntimeException if attempted to create more than a single active JMS context. (Please refer JEE 7 Spec, section 6:7)</span>Let's Message and Streamhttp://www.blogger.com/profile/00059356931709697164noreply@blogger.com0tag:blogger.com,1999:blog-8623436262927880743.post-21609497538662810872013-10-31T09:21:00.002-07:002013-11-01T01:08:25.854-07:00JMS Connection Factories Explained<span style="font-family: Verdana, sans-serif;"><b><u>What ConnectionFactory should I use in my application ?</u></b></span><br />
<span style="font-family: Verdana, sans-serif;"><br /></span>
<span style="font-family: Verdana, sans-serif;">I thought it would be good to explain a bit about connection factories before I go on explaining <b>JMS 2.0</b>. The connection factories are one of the two administrative objects offered by JMS API. Both JMS 1.1 and 2.0 support the generic <b>ConnectionFactory</b>. The connection factories support concurrent use just like the Destination administrative object. There are domain specific connection factories in JMS 1.1 spec and they remain unchanged in 2.0. I personally discourage the use of domain specific connection factories just as it was said in the spec. The <b>WildFly</b> application server provides four connectionfactory instances on its default JMS provider, HornetQ's configuration :</span><br />
<br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><jms-connection-factories></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> <connection-factory name="InVmConnectionFactory"></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> <connectors></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> <connector-ref connector-name="in-vm"/></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> </connectors></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> <entries></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> <entry name="java:jboss/DefaultJMSConnectionFactory"/></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> <entry name="java:/ConnectionFactory"/></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> </entries></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> </connection-factory></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> <connection-factory name="ServletConnectionFactory"></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> <connectors></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> <connector-ref connector-name="servlet"/></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> </connectors></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> <entries></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> <entry name="java:jboss/exported/jms/ServletConnectionFactory"/></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> </entries></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> </connection-factory></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> <connection-factory name="RemoteConnectionFactory"></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> <connectors></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> <connector-ref connector-name="netty"/></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> </connectors></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> <entries></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> <entry name="java:jboss/exported/jms/RemoteConnectionFactory"/></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> </entries></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> <confirmation-window-size>100</confirmation-window-size></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> </connection-factory></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> <pooled-connection-factory name="hornetq-ra"></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> <transaction mode="xa"/></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> <connectors></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> <connector-ref connector-name="in-vm"/></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> </connectors></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> <entries></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> <entry name="java:/JmsXA"/></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> </entries></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> </pooled-connection-factory></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"></jms-connection-factories></span><br />
<br />
<span style="font-family: Verdana, sans-serif;">The connection factory instances differentiate by their characteristics. I would rather explain in terms of transport layer and on application type to aid what instance to be used in a client application. </span><br />
<span style="font-family: Verdana, sans-serif;"><br /></span>
<span style="font-family: Verdana, sans-serif;"><b><u>Remote JMS clients :</u></b></span><br />
<span style="font-family: Verdana, sans-serif;">I would recommend the factory bound at <b>jms/RemoteConnectionFactory</b> or <b>jms/ServletConnectionFactory</b> for remote JMS clients. The latter uses servlet transport over the configured http port where as the former uses netty on port 5445. The http bound connection factory resolves the need of opening a port on the firewall.</span><br />
<span style="font-family: Verdana, sans-serif;"><br /></span>
<span style="font-family: Verdana, sans-serif;"><b><u>Clients inside the same container :</u></b></span><br />
<span style="font-family: Verdana, sans-serif;">The clients who reside the in the same container should obtain connections from the JCA based connection factory; from the factory bound at <b>java:/JmsXA</b>. It is considered an anti-pattern to obtain connections other than the factory bound at java:/JmsXA . When you obtain connections from this factory, you're indeed obtaining connections from the <b>ManagedConnectionPool</b> (MCP).</span><br />
<span style="font-family: Verdana, sans-serif;"><br /></span>
<span style="font-family: Verdana, sans-serif;">When you obtain connections from the factory bound at <b>java:/JmsXA</b>, it's not only just a method call but the connection objects support two phase commit protocol. Hence, they can be enlisted in a global transaction. Further you're obtaining connections from JCA's MCP, with the container managed security. </span><br />
<span style="font-family: Verdana, sans-serif;"><br /></span>
<span style="font-family: Verdana, sans-serif;">However there's a limitation imposed by the <b>JEE 7 specification, under the section 6:7</b>. It does not permit EJB/Web applications to have more than a single active session from a connection obtained from the MCP. This restriction does not encourage JMS clients to use a JVM based connection factory inside the container, which is meant for legacy JMS applications. Instead, the users must make sure to reuse JMS objects efficiently since JMS objects are reusable.</span><br />
<span style="font-family: Verdana, sans-serif;"><br /></span>
<span style="font-family: Verdana, sans-serif;">The purpose of using a JMS resource adapter is compromised and nullified when JMS clients obtain connections from anywhere other than the managed connection pool; when they JMS clients are inside the same container. It is a bad practice use any connection factory than the JCA based factory.</span><br />
<span style="font-family: Verdana, sans-serif;"><br /></span>
<span style="font-family: Verdana, sans-serif;">The JMS ConnectionFactory and Connection objects can be concurrently accessed and reusable. The plain JMS clients must make sure to cache and reuse connection objects instead of obtaining a connection at each message send. Although session objects are reusable, I would not encourage them to be shared across threads, to assure thread safety. Further, it might have an adverse impact on transacted sessions. However, you don't have to cache JMS resources inside the container, the container does this for you when you obtain connections from the MCP.</span>Let's Message and Streamhttp://www.blogger.com/profile/00059356931709697164noreply@blogger.com0tag:blogger.com,1999:blog-8623436262927880743.post-25592680212432388992013-10-01T03:36:00.000-07:002013-10-01T07:34:20.606-07:00adding JMS support to the stock standalone.xml in wildfly 8<span style="font-family: Verdana, sans-serif;">The stock standalone.xml configuration doesn't contain JMS support by default but standalone-full.xml. I thought of adding the messaging subsystem to the default configuration to make it easy. Here's how to do it :</span><br />
<span style="font-family: Verdana, sans-serif;"><br /></span>
<span style="font-family: Verdana, sans-serif;">The WildFly server would instantiate the JMS subsystem when you simply add the messaging subsystem with <hornetq-server />, as follows :</span><br />
<span style="font-family: Verdana, sans-serif;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"><b><subsystem xmlns="urn:jboss:domain:messaging:1.4"></b></span><br />
<span style="font-family: Courier New, Courier, monospace;"><b> <hornetq-server /></b></span><br />
<span style="font-family: Courier New, Courier, monospace;"><b></subsystem></b></span><br />
<span style="font-family: Verdana, sans-serif;"><br /></span>
<span style="font-family: Verdana, sans-serif;">However, adding the above configuration alone would not suffice. You have to tell the server to load the messaging module, which contains necessary libraries to host the JMS subsystem. We have to define the messaging module under the list of "extentions".</span><br />
<span style="font-family: Verdana, sans-serif;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"><b><extensions></b></span><br />
<span style="font-family: Courier New, Courier, monospace;"><b> ....</b></span><br />
<span style="font-family: Courier New, Courier, monospace;"><b> ....</b></span><br />
<span style="font-family: Courier New, Courier, monospace;"><b> <extension module="org.jboss.as.messaging"/></b></span><br />
<span style="font-family: Courier New, Courier, monospace;"><b></extensions></b></span><br />
<span style="font-family: Verdana, sans-serif;"><br /></span>
<span style="font-family: Verdana, sans-serif;">Although this configuration would accommodate JMS support in the server, it would still not support MDB deployment. The next step to define and configure an MDB container. </span><br />
<span style="font-family: Verdana, sans-serif;"> </span><br />
<span style="font-family: Courier New, Courier, monospace;"><b><subsystem xmlns="urn:jboss:domain:ejb3:2.0"></b></span><br />
<span style="font-family: Courier New, Courier, monospace;"><b> ....</b></span><br />
<span style="font-family: Courier New, Courier, monospace;"><b> ....</b></span><br />
<span style="font-family: Courier New, Courier, monospace;"><b> <mdb></b></span><br />
<span style="font-family: Courier New, Courier, monospace;"><b> <resource-adapter-ref resource-adapter-name="hornetq-ra"/></b></span><br />
<span style="font-family: Courier New, Courier, monospace;"><b> <bean-instance-pool-ref pool-name="mdb-strict-max-pool"/></b></span><br />
<span style="font-family: Courier New, Courier, monospace;"><b> </mdb></b></span><br />
<span style="font-family: Courier New, Courier, monospace;"><b> <pools></b></span><br />
<span style="font-family: Courier New, Courier, monospace;"><b> <bean-instance-pools></b></span><br />
<span style="font-family: Courier New, Courier, monospace;"><b> <strict-max-pool name="slsb-strict-max-pool" max-pool-size="20" instance-acquisition-timeout="5" instance-acquisition-timeout-unit="MINUTES"/></b></span><br />
<span style="font-family: Courier New, Courier, monospace;"><b> <strict-max-pool name="mdb-strict-max-pool" max-pool-size="20" instance-acquisition-timeout="5" instance-acquisition-timeout-unit="MINUTES"/></b></span><br />
<span style="font-family: Courier New, Courier, monospace;"><b> </bean-instance-pools></b></span><br />
<span style="font-family: Courier New, Courier, monospace;"><b> </pools></b></span><br />
<span style="font-family: Courier New, Courier, monospace;"><b></subsystem></b></span><br />
<span style="font-family: Verdana, sans-serif;"><br /></span>
<span style="font-family: Verdana, sans-serif;">The bean instance pools have already been defined in the stock standlone.xml file but you need to configure the MDB container within <mdb />. </span><br />
<div>
<br /></div>
Let's Message and Streamhttp://www.blogger.com/profile/00059356931709697164noreply@blogger.com0tag:blogger.com,1999:blog-8623436262927880743.post-16543605090007510062013-10-01T03:12:00.002-07:002013-10-01T03:38:37.676-07:00installing wildfly 8 alpha 4<span style="font-family: Verdana, sans-serif;">JEE 7 with WildFly 8</span><br />
<span style="font-family: Verdana, sans-serif;"><br /></span>
<span style="font-family: Verdana, sans-serif;">I thought of playing around JEE7 on the upcoming WildFly 8. At the writing of this, WF-8-Alpha4 was the latest available and there's no GA. I will be starting with basics of WF and as I move on, I believe it should be ready and comply with the full JEE 7 TCK. Since I do have a very short lived memory, I believe writing every little detail would help myself in the long run. I doubt I would explore all components of JEE 7 stack, instead I would probably focus on JCA 1.7, Transactions 1.2, JMS 2.0 and EJB 3.2.</span><br />
<span style="font-family: Verdana, sans-serif;"><br /></span>
<span style="font-family: Verdana, sans-serif;"><b>Installation :</b></span><br />
<span style="font-family: Verdana, sans-serif;">WildFly-8 Alpha 4 can be downloaded from the community web at the following location :</span><br />
<span style="font-family: Verdana, sans-serif;"><a href="http://www.wildfly.org/download/">http://www.wildfly.org/download/</a> or directly from </span><br />
<a href="http://download.jboss.org/wildfly/8.0.0.Alpha4/wildfly-8.0.0.Alpha4.zip"><span style="font-family: Verdana, sans-serif;">http://download.jboss.org/wildfly/8.0.0.Alpha4/wildfly-8.0.0.Alpha4.zip</span></a><br />
<span style="font-family: Verdana, sans-serif;"><br /></span>
<span style="font-family: Verdana, sans-serif;">The installation is pretty easy, just unzip the downloaded wildfly-8.0.0.Alpha4.zip to a preferred directory. The server would start the default standlone.xml configuration should you run ./standalone.sh from the $WF_HOME/bin directory. To list all available startup options, please try :</span><br />
<span style="font-family: Courier New, Courier, monospace;"><b>[bershath@shimmer bin]$ ./standalone.sh --help</b></span><br />
<span style="font-family: Verdana, sans-serif;"><br /></span>
<span style="font-family: Verdana, sans-serif;">To bind the application server to a specific port :</span><br />
<span style="font-family: Courier New, Courier, monospace;"><b>[bershath@shimmer bin]$ ./standalone.sh -b 192.168.1.50</b></span><br />
<span style="font-family: Verdana, sans-serif;"><br /></span>
<span style="font-family: Verdana, sans-serif;">The standalone.conf in the bin directory contains a few startup options, it's recommended to tweak these attributes to accommodate specific memory or user requirements. </span>Let's Message and Streamhttp://www.blogger.com/profile/00059356931709697164noreply@blogger.com0tag:blogger.com,1999:blog-8623436262927880743.post-38977668888960011622013-09-14T22:55:00.003-07:002013-09-14T22:56:16.415-07:00disclaimer<span style="font-family: Verdana, sans-serif;">I thought it would be good to maintain a separate blog to capture my tech notes. </span><span style="font-family: Verdana, sans-serif;">Although I maintain a blog on life, outside the world dominated by zeroes and ones. This would capture my day to day technical bits.</span><br />
<div>
<br /></div>
<div>
<span style="font-family: Verdana, sans-serif;">I'm not certain I'm writing this blog for the world outside. I truly want to track and note the important things I do for my own references, a journal. That said, I would keep this blog open so the others might benefit with what I write, if that's so. I'm still not sure on the latter though. </span></div>
<div>
<span style="font-family: Verdana, sans-serif;"><br /></span></div>
<div>
<span style="font-family: Verdana, sans-serif;">The views/ideas/thoughts expressed on this blog are mine alone. All are my utmost personal thoughts and views and do not reflect the views of my employer or its affiliated entities.</span></div>
<div>
<span style="font-family: Verdana, sans-serif;"><br /></span></div>
<div>
<br /></div>
<a href="http://creativecommons.org/licenses/by-nc-nd/3.0/deed.en_US" rel="license"><img alt="Creative Commons License" src="http://i.creativecommons.org/l/by-nc-nd/3.0/88x31.png" style="border-width: 0;" /></a><br />
<span property="dct:title" xmlns:dct="http://purl.org/dc/terms/">This blog</span> by <a href="http://jmsrar.blogspot.com.au/" property="cc:attributionName" rel="cc:attributionURL" xmlns:cc="http://creativecommons.org/ns#">Tyronne W</a> is licensed under a <a href="http://creativecommons.org/licenses/by-nc-nd/3.0/deed.en_US" rel="license">Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported License</a>.<br />
Based on a work at <a href="http://jmsrar.blogspot.com.au/" rel="dct:source" xmlns:dct="http://purl.org/dc/terms/">http://jmsrar.blogspot.com.au/</a>.Let's Message and Streamhttp://www.blogger.com/profile/00059356931709697164noreply@blogger.com0