1. Lingo
  2. LINGO-41

async configuration breaks when upgrading from lingo 1.1


    • Type: Bug Bug
    • Status: Open Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Labels:
    • Number of attachments :


      I upgraded from Lingo 1.1 to Lingo 1.3 and ran into the same issue where async calls that were previously working are no longer asynchronous. I ran it though a debugger and found the cause.

      Previously Lingo async was configured as follows :

      <bean id="invocationFactory" class="org.logicblaze.lingo.LingoRemoteInvocationFactory">
      <bean class="org.logicblaze.lingo.SimpleMetadataStrategy">
      <!-- enable async one ways -->
      <constructor-arg value="true"/>

      <bean id="optimizerService" class="org.logicblaze.lingo.jms.JmsProxyFactoryBean">
      <!-- lets enable async one ways on the client -->
      <property name="remoteInvocationFactory" ref="invocationFactory"/>

      Between versions 65 and 65 of the class JmsClientinterceptor ( ), the member

      MetadataStrategy metadataStrategy;

      was added directly to JmsClientinterceptor which in turn was overriding the LingoRemoteInvocationFactory's previous metadataStrategy member in its afterPropertiesSet() method.

      public void afterPropertiesSet() throws JMSException {
      RemoteInvocationFactory factory = getRemoteInvocationFactory();

      { LingoRemoteInvocationFactory invocationFactory = (LingoRemoteInvocationFactory) factory; invocationFactory.setMetadataStrategy(getMetadataStrategy()); }


      public MetadataStrategy getMetadataStrategy() {
      if (metadataStrategy == null)

      { metadataStrategy = createMetadataStrategy(); }

      return metadataStrategy;

      So while the new way of specifying async calls by setting the metadataStrategy directly on JmsProxyFactoryBean (see below) works, it breaks backward compatibility with previous configurations where metadataStrategy was set on the invocationFactory . For now just set the metadataStrategy directly on JmsProxyFactoryBean.

      James, I think the fix that preserves existing behavior while maintaining backward compatibilty just involves adding a check to test if the invocationFactory's metadataStrategy is null before calling setMetadataStrategy in JmsClientInterceptor#afterPropertiesSet().

      LingoRemoteInvocationFactory invocationFactory = (LingoRemoteInvocationFactory) factory;
      >> if(invocationFactory.getMetadataStrategy() == null)


      working async config :

      <bean id="client" class="org.logicblaze.lingo.jms.JmsProxyFactoryBean"
      <property name="serviceInterface" value="org.logicblaze.lingo.example.ExampleService"/>
      <property name="connectionFactory" ref="jmsFactory"/>
      <property name="destination" ref="exampleDestination"/>

      <!-- lets enable async one ways on the client -->
      <property name="metadataStrategy" ref="metadataStrategy"/>

      <!-- define the metadata strategy -->
      <bean id="metadataStrategy" class="org.logicblaze.lingo.SimpleMetadataStrategy">
      <!-- enable async one ways -->
      <constructor-arg value="true"/>


        No changes have yet been made on this issue.


          • Assignee:
            Sanjiv Jivan


            • Created: