Now I have Java code, which starts with Tibak JMS membership in several stages:
property properties = new properties (); Propsput ("java.naming.provider.url", naming provider); Propsput ("java.naming.factory.initial", naming Factory); Propsput ("java.naming.referral", naming referrals); Propsput ("java.naming.security.credentials", security credentials); Propsput ("java.naming.security.principal", security principal); Context = new initial context (Sahara); Subject Connection Fitter Factor = (TopconEXenFactory) Reference. Lookup (url + topic + ": TCF"); TopicConnection = tfactory.createTopicConnection (user, password); TopicConnection.setExceptionListener (exceptionListener); Subject session = topicConnection.cricketTipic session (false, session.AUTO_ACKNOWLEDGE); Subscriber = Subject: Content Subscriber (Subject) Reference.Lux (URL + topic + ": subject"), selector, true); Subscriber.setMessageListener (messageListener); TopicConnection.start ();
I want to use spring for initialization, but I can not find the way to configure JM in spring from the initial reference. Can you help me with this? Thanks! You can try something like this to get TopicConnectionFactory:
& lt; Bean id = "TFFree" class = "org.springframework.jndi.JndiObjectFactoryBean" & gt; & Lt; Property Name = "jndiName" Value = "URL / Subject: TCF" /> & Lt; Property Name = "jndiEnvironment" & gt; & Lt; Theater Content & gt; & Lt; Prop key = "java.naming.provider.url" & gt; ... & lt; / Prop & gt; & Lt; Prop key = "java.naming.factory.initial" & gt; ... & lt; / Prop & gt; & Lt; Prop key = "java.naming.referral" & gt; ... & lt; / Prop & gt; & Lt; Prop key = "java.naming.security.credentials" & gt; ... & lt; / Prop & gt; & Lt; Prop key = "java.naming.security.principal" & gt; ... & lt; / Prop & gt; & Lt; / Theater & gt; & Lt; / Property & gt; & Lt; / Bean & gt;
Comments
Post a Comment