You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@synapse.apache.org by tsaha <Ta...@westernasset.com> on 2008/07/12 02:28:45 UTC
JMSUtil does not set all JMS Connection properties specified in
axis2.xml
Hi Asankha/Ruwan:
JMSUtil.java in the JMS transport module does set all JMS Connection
properties specified in axis2.xml.
For Sonic MQ, there is one vendor specific JMS connection property
"com.sonicsw.jndi.mfcontext.domain", which I have specified in my axis2.xml
file , but JMSUtils.java set only the following properties,
public static void setConnectionFactoryParameters(
Parameter param, JMSConnectionFactory jmsConFactory) {
ParameterIncludeImpl pi = new ParameterIncludeImpl();
try {
pi.deserializeParameters((OMElement) param.getValue());
} catch (AxisFault axisFault) {
log.error("Error reading parameters for JMS connection factory"
+
jmsConFactory.getName(), axisFault);
}
Iterator params = pi.getParameters().iterator();
while (params.hasNext()) {
Parameter p = (Parameter) params.next();
if (JMSConstants.CONFAC_TYPE.equals(p.getName())) {
String connectionFactoryType = (String) p.getValue();
jmsConFactory.setConnectionFactoryType(connectionFactoryType);
} else if (JMSConstants.RECONNECT_TIMEOUT.equals(p.getName())) {
String strTimeout = (String) p.getValue();
int reconnectTimeoutSeconds = Integer.parseInt(strTimeout);
long reconnectTimeoutMillis = reconnectTimeoutSeconds * 1000;
jmsConFactory.setReconnectTimeout(reconnectTimeoutMillis);
} else if (Context.INITIAL_CONTEXT_FACTORY.equals(p.getName()))
{
jmsConFactory.addJNDIContextProperty(
Context.INITIAL_CONTEXT_FACTORY, (String) p.getValue());
} else if (Context.PROVIDER_URL.equals(p.getName())) {
jmsConFactory.addJNDIContextProperty(
Context.PROVIDER_URL, (String) p.getValue());
} else if (Context.SECURITY_PRINCIPAL.equals(p.getName())) {
jmsConFactory.addJNDIContextProperty(
Context.SECURITY_PRINCIPAL, (String) p.getValue());
} else if (Context.SECURITY_CREDENTIALS.equals(p.getName())) {
jmsConFactory.addJNDIContextProperty(
Context.SECURITY_CREDENTIALS, (String) p.getValue());
} else if
(JMSConstants.CONFAC_JNDI_NAME_PARAM.equals(p.getName())) {
jmsConFactory.setConnFactoryJNDIName((String) p.getValue());
jmsConFactory.addJNDIContextProperty(
JMSConstants.CONFAC_JNDI_NAME_PARAM, (String)
p.getValue());
}
}
}
As a result it cannot connect to the right Domain of Sonic MQ. My axis2.xml
looks like
<transportReceiver name="jms"
class="org.apache.synapse.transport.jms.JMSListener">
<parameter name="myTopicConnectionFactory">
<parameter
name="java.naming.factory.initial">com.sonicsw.jndi.mfcontext.MFContextFactory</parameter>
<parameter
name="java.naming.provider.url">tcp://sonicdev3:3506</parameter>
<parameter
name="com.sonicsw.jndi.mfcontext.domain">dev3Domain</parameter>
<parameter
name="java.naming.security.principal">Administrator</parameter>
<parameter
name="java.naming.security.credentials">Administrator</parameter>
<parameter
name="transport.jms.ConnectionFactoryJNDIName">SonicTopicConnectionFactory</parameter>
<parameter name="transport.jms.ConnectionFactoryType"
locked="false">topic</parameter>
</parameter>
<parameter name="myQueueConnectionFactory">
<parameter
name="java.naming.factory.initial">com.sonicsw.jndi.mfcontext.MFContextFactory</parameter>
<parameter
name="java.naming.provider.url">tcp://sonicdev3:3506</parameter>
<parameter
name="com.sonicsw.jndi.mfcontext.domain">dev3Domain</parameter>
<parameter
name="java.naming.security.principal">Administrator</parameter>
<parameter
name="java.naming.security.credentials">Administrator</parameter>
<parameter
name="transport.jms.ConnectionFactoryJNDIName">SonicQueueConnectionFactory</parameter>
<parameter name="transport.jms.ConnectionFactoryType"
locked="false">queue</parameter>
</parameter>
</transportReceiver>
I have tested this by building Synapse from source with some debug statement
in JNDIConnectionFactory
as
log.info("com.sonicsw.jndi.mfcontext.domain=" + (String)
jndiProperties.get("com.sonicsw.jndi.mfcontext.domain"));
My log shows 2008-07-11 17:10:15,652 [10.200.182.100-PS-TSAHA]
[WrapperSimpleAppMain] INFO JMSConnectionFactory
com.sonicsw.jndi.mfcontext.domain=null
Pl fix this issue
-thanks
tanmay
--
View this message in context: http://www.nabble.com/JMSUtil-does-not-set-all-JMS-Connection-properties-specified-in-axis2.xml-tp18414679p18414679.html
Sent from the Synapse - User mailing list archive at Nabble.com.
Re: JMSUtil does not set all JMS Connection properties specified in
axis2.xml
Posted by tsaha <Ta...@westernasset.com>.
Hi Asankha:
I opened the following JIRA with proposed fix/solution
https://issues.apache.org/jira/browse/SYNAPSE-399
-Thanks
tanmay
asankha wrote:
>
> Hi Tanmay
>
> tsaha wrote:
>> Hi Asankha/Ruwan:
>>
>> JMSUtil.java in the JMS transport module does set all JMS Connection
>> properties specified in axis2.xml.
>>
> Please address emails to the list in future, as there are many others
> who can help with a problem..
>> I have tested this by building Synapse from source with some debug
>> statement
>> in JNDIConnectionFactory
>> as
>>
>> log.info("com.sonicsw.jndi.mfcontext.domain=" + (String)
>> jndiProperties.get("com.sonicsw.jndi.mfcontext.domain"));
>>
>>
>> My log shows 2008-07-11 17:10:15,652 [10.200.182.100-PS-TSAHA]
>> [WrapperSimpleAppMain] INFO JMSConnectionFactory
>> com.sonicsw.jndi.mfcontext.domain=null
>>
>> Pl fix this issue
>>
> Can you please file a JIRA with these details, and also any proposed fix
>
> asankha
>
> --
> Asankha C. Perera
>
> WSO2 - http://wso2.org
> http://esbmagic.blogspot.com
>
>
>
--
View this message in context: http://www.nabble.com/JMSUtil-does-not-set-all-JMS-Connection-properties-specified-in-axis2.xml-tp18414679p18448238.html
Sent from the Synapse - User mailing list archive at Nabble.com.
Re: JMSUtil does not set all JMS Connection properties specified
in axis2.xml
Posted by "Asankha C. Perera" <as...@wso2.com>.
Hi Tanmay
tsaha wrote:
> Hi Asankha/Ruwan:
>
> JMSUtil.java in the JMS transport module does set all JMS Connection
> properties specified in axis2.xml.
>
Please address emails to the list in future, as there are many others
who can help with a problem..
> I have tested this by building Synapse from source with some debug statement
> in JNDIConnectionFactory
> as
>
> log.info("com.sonicsw.jndi.mfcontext.domain=" + (String)
> jndiProperties.get("com.sonicsw.jndi.mfcontext.domain"));
>
>
> My log shows 2008-07-11 17:10:15,652 [10.200.182.100-PS-TSAHA]
> [WrapperSimpleAppMain] INFO JMSConnectionFactory
> com.sonicsw.jndi.mfcontext.domain=null
>
> Pl fix this issue
>
Can you please file a JIRA with these details, and also any proposed fix
asankha
--
Asankha C. Perera
WSO2 - http://wso2.org
http://esbmagic.blogspot.com