cxf-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gueugaie <gueug...@gmail.com>
Subject Re: SOAP over JMS using secured Weblogic JMS Module
Date Fri, 08 Jan 2016 11:23:53 GMT
Hi,

Propagating the JNDI properties of the endpoint would be great!
One could make that a config option on the JMSConfig object, something
along the lines of what Spring does with the "exposeAccessContext" option,
(see
http://docs.spring.io/spring-framework/docs/2.5.6/api/org/springframework/jndi/JndiObjectFactoryBean.html#setExposeAccessContext%28boolean%29),
although we would have to use it both while accessing the JNDI directory,
and while polling (see https://jira.spring.io/browse/SPR-5869).


I have just cloned the repo and started hacking.
My first quick&dirty test to see if this could work was to modify
PollingMessageListenerContainer$Poller#run() to create an InitialContext
before the createSession call, and close it in the finally.
The core of the hack is :

@@ -49,10 +52,18 @@ public class PollingMessageListenerContainer extends
AbstractMessageListenerCont
         @Override
         public void run() {
             while (running) {
+                Properties jndiProps = new Properties();
                 MessageConsumer consumer = null;
                 Session session = null;
+                InitialContext ic = null;
                 try {
                     // Create session early to optimize performance
+                    jndiProps.put(Context.INITIAL_CONTEXT_FACTORY,
"weblogic.jndi.WLInitialContextFactory");
+                    jndiProps.put(Context.PROVIDER_URL,
"t3://localhost:7001");
+                    jndiProps.put(Context.SECURITY_PRINCIPAL, "jmsuser");
+                    jndiProps.put(Context.SECURITY_CREDENTIALS, "jmspwd");
+                    ic = new InitialContext(jndiProps);
+
                     session = connection.createSession(transacted,
acknowledgeMode);
                     consumer = createConsumer(session);

I can confirm that this actually solves the secured resource issue. I'll
try the "cleaner" solution you suggested with the ExecutorService, but it
looks like we're on the right path.

Guillaume

2016-01-07 19:39 GMT+01:00 Christian Schneider <chris@die-schneider.net>:

> Can you try to get it working with the cxf code from the master branch and
> a custom executor. If that works I will try to adapt the implementation so
> it works by default.
> I think we can make this work using the jndi properties of the endpoint. So
> it is possible to have different jms setups in the same process.
>
> Christian
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message