The way to get JMS over HTTP(S) working (tested on jboss-4.0.1sp1): 1) download jboss4guide = the examples sources
You get there by clicking the first icon next to JBoss AS, and then the code link under jboss 4 - JBoss 4 Application Server Guide (v2) HTML code 2) make an .../jboss4guide/examples/ant.properties file where you define | jboss.dist=your-jboss-install-folder (use forward slashes) | 3) compile the examples by running | .../jboss4guide/examples>ant | 4) setup the chap3-example-jboss config by running | .../jboss4guide/examples>ant -Dchap=chap3 config | What happens here = a new jboss deployment setup is created (next to default, all and minimal). To make this chap3-deployment, ant will start by taking a copy of the server/default folder, so make sure this one is "clean" = untouched = like it was when you installed jboss. Now you can run this jboss setup by doing jboss4/bin>run -c chap3 5) To make JMS go over HTTP, all you have to do is make sure you look up "HTTPConnectionFactory" in the jndi of jboss. 6) You probably want to do JNDI over HTTP(S) as well. This is your jndi.properties file if you need HTTPS: | java.naming.factory.initial org.jboss.naming.HttpNamingContextFactory | java.naming.provider.url https://[some ip or localhost]:8443/invoker/JNDIFactorySSL | java.naming.factory.url.pkgs org.jboss.naming:org.jnp.interfaces;java.protocol.handler.pkgs | I don't know how to specify you need jndi over http, but it probably is the same, except for the second line: | java.naming.provider.url http://[some ip or localhost]:8443/invoker/JNDIFactory | If you have this one on your classpath, new InitialContext() will use these properties, to make a Context implementation that uses HTTPS to do it's job. When you run a client, that uses HTTPS to do jndi lookups, you must make sure that this client trusts the server. This means the client must be aware of a keystore, when you start it. Therefore, when you run your jms client, make sure to pass these parameters into java: | -Djavax.net.ssl.trustStore=d:/jboss-4.0.1sp1/server/chap3/conf/chap8.keystore -Dorg.jboss.security.ignoreHttpsHost=true | As you can see, i refer to chap8.keystore inside my jboss. By using the same keystore, the client trusts the server. This trick is used in the examples chap3. 7) If you want JMS to talk over HTTPS as well, you'll make sure that this file chap3\deploy\jms\jbossmq-httpil.sar\META-INF\jboss-service.xml contains these attributes: | <mbean code="org.jboss.mq.il.http.HTTPServerILService"> | ... | <attribute name="URLPrefix">https://</attribute> | <attribute name="URLPort">8443</attribute> | ... | </mbean> | 8) Other attributes in that file, that are important when you do JMS over HTTP(S): This means "every 10 seconds, a consumer will poll the jms server, to see if there's a message for him: | <attribute name="TimeOut">0</attribute> | <attribute name="RestInterval">10</attribute> | This means "every 60 seconds, a consumer will poll the jms server and spend at most 10 seconds of waiting there, if no message was available: | <attribute name="TimeOut">10</attribute> | <attribute name="RestInterval">60</attribute> | Since HTTP is has no session notion, the implementation must use ping-messages to find out wheter our not some connection is still valid. You can determine, that every 10 seconds, such a ping should occur. | <attribute name="PingPeriod">10</attribute> | To see this in action, enable logging in a log4j.properties at your classpath: | log4j.rootCategory=INFO, Default | | # Dumps logging into jbossmq.log | # log4j.appender.Default=org.apache.log4j.FileAppender | log4j.appender.Default=org.apache.log4j.ConsoleAppender | log4j.appender.Default.File=jbossmq.log | log4j.appender.Default.layout=org.apache.log4j.PatternLayout | log4j.appender.Default.layout.ConversionPattern=%d %-5p [%c(1)] {%t} %m%n | log4j.appender.Default.Append=false | | # TRACE level logging | log4j.category.org.jboss.mq=TRACE#org.jboss.logging.XLevel | | # Uncomment to filter invocation layer (transport) logging | # log4j.category.org.jboss.mq.il=INFO | 9) Now read the ant script that set up server/chap3 for you, to see which config files are used for what purpose. View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3867774#3867774 Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3867774 ------------------------------------------------------- SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click _______________________________________________ JBoss-user mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/jboss-user
