Uploaded image for project: 'Camel'
  1. Camel
  2. CAMEL-14212

camel-groovy does not export correct "properties" property

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Won't Fix
    • 2.20.4, 2.24.0
    • None
    • camel-groovy
    • None
    • Unknown

    Description

      groovy language is expected to export "properties" as org.apache.camel.builder.script.PropertiesFunction but it turns out "properties" is a LinkedHashMap without .resolve() method.

      Just try the simple context:
      <?xml version="1.0" encoding="UTF-8"?>
      <beans xmlns="http://www.springframework.org/schema/beans"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsdhttp://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd">
       
      <bean id="properties"class="org.apache.camel.component.properties.PropertiesComponent">
      <property name="location" value="classpath:myprop.properties"/>
      </bean>
      <camelContext xmlns="http://camel.apache.org/schema/spring">
      <route>
      <from uri="timer:timer?repeatCount=1"/>
      <setBody>
      <groovy>properties</groovy>
      </setBody>
      <to uri="log:debug?showAll=true&multiline=true"/>
      </route>
      </camelContext>
      </beans>
       
      The output is:

      [l-1) thread #2 - timer://timer] debug                          INFO  Exchange[

      , Id: ID-mba2015-lan-1574592722421-0-1

      , ExchangePattern: InOnly

      , Properties: {CamelCreatedTimestamp=Sun Nov 24 11:52:03 CET 2019, CamelExternalRedelivered=false, CamelMessageHistory=[DefaultMessageHistory[routeId=route1, node=setBody1], DefaultMessageHistory[routeId=route1, node=to1]], CamelTimerCounter=1, CamelTimerFiredTime=Sun Nov 24 11:52:03 CET 2019, CamelTimerName=timer, CamelTimerPeriod=1000, CamelToEndpoint=log://debug?multiline=true&showAll=true}

      , Headers: {breadcrumbId=ID-mba2015-lan-1574592722421-0-1, firedTime=Sun Nov 24 11:52:03 CET 2019}

      , BodyType: java.util.LinkedHashMap

      , Body: {class=class script1574592724113926053069, binding=groovy.lang.Binding@748ee9f1}

      , Out: null: 

      ]

      Attachments

        Activity

          People

            Unassigned Unassigned
            webfrank Francesco Boscarino
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: