Uploaded image for project: 'Red Hat Fuse'
  1. Red Hat Fuse
  2. ENTESB-10640

JdbcAggregationRepository does not work with postgresql's OID data type for exchange column

    Details

    • Type: Enhancement
    • Status: Closed
    • Priority: Major
    • Resolution: Done
    • Affects Version/s: fuse-7.2, fuse-7.3
    • Fix Version/s: fuse-7.4-GA
    • Component/s: Camel
    • Labels:
      None
    • Sprint:
      Fuse 7.4 Sprint 47 - Bug Fix

      Description

      Postgresql supports OID data type(not bytea) to treat a large object. Also org.springframework.jdbc.support.lob.LobHandler supports it with "wrapAsLob" property.(1)
      If user use it with org.apache.camel.processor.aggregate.jdbc.JdbcAggregationRepository, reading resultset always fail(2) due to incorrect way to treat a BinaryStream object.

      (1)
      https://docs.spring.io/spring/docs/current/javadoc-api/org/springframework/jdbc/support/lob/LobHandler.html

      (2)

      2019-05-09 13:45:36,725 | ERROR | ead #2 - timer://run | o.a.c.p.DefaultErrorHandler      | 62 - org.apache.camel.camel-core - 2.21.0.fuse-730078-redhat-00001 | Failed delivery for (MessageId: ID-unused-220-201-nrt-redhat-com-1557376031933-3-5 on ExchangeId: ID-unused-220-201-nrt-redhat-com-1557376031933-3-4). Exhausted after delivery attempt: 1 caught: java.lang.RuntimeException: Error getting key true from repository aggregation
      
      Message History
      ---------------------------------------------------------------------------------------------------------------------------------------
      RouteId              ProcessorId          Processor                                                                        Elapsed (ms)
      [_route1           ] [_route1           ] [timer://run?repeatCount=2                                                     ] [         9]
      [_route1           ] [_transacted1      ] [transacted                                                                    ] [         0]
      [_route1           ] [_setBody1         ] [setBody[simple{5/9/19 1:45 PM}]                              ] [         1]
      [_route1           ] [_log1             ] [log                                                                           ] [         1]
      [_route1           ] [_aggregate1       ] [aggregate[true]                                                               ] [         0]
      
      Stacktrace
      ---------------------------------------------------------------------------------------------------------------------------------------
      java.lang.RuntimeException: Error getting key true from repository aggregation
      	at org.apache.camel.processor.aggregate.jdbc.JdbcAggregationRepository$3.doInTransaction(JdbcAggregationRepository.java:295) ~[233:org.apache.camel.camel-sql:2.21.0.fuse-730078-redhat-00001]
      	at org.apache.camel.processor.aggregate.jdbc.JdbcAggregationRepository$3.doInTransaction(JdbcAggregationRepository.java:284) ~[233:org.apache.camel.camel-sql:2.21.0.fuse-730078-redhat-00001]
      	at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:133) ~[172:org.apache.servicemix.bundles.spring-tx:4.3.20.RELEASE_1]
      	at org.apache.camel.processor.aggregate.jdbc.JdbcAggregationRepository.get(JdbcAggregationRepository.java:284) ~[233:org.apache.camel.camel-sql:2.21.0.fuse-730078-redhat-00001]
      	at org.apache.camel.processor.aggregate.jdbc.JdbcAggregationRepository.get(JdbcAggregationRepository.java:276) ~[233:org.apache.camel.camel-sql:2.21.0.fuse-730078-redhat-00001]
      	at org.apache.camel.processor.aggregate.AggregateProcessor.doAggregation(AggregateProcessor.java:390) ~[62:org.apache.camel.camel-core:2.21.0.fuse-730078-redhat-00001]
      	at org.apache.camel.processor.aggregate.AggregateProcessor.doProcess(AggregateProcessor.java:350) ~[62:org.apache.camel.camel-core:2.21.0.fuse-730078-redhat-00001]
      	at org.apache.camel.processor.aggregate.AggregateProcessor.process(AggregateProcessor.java:271) ~[62:org.apache.camel.camel-core:2.21.0.fuse-730078-redhat-00001]
      	at org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:548) [62:org.apache.camel.camel-core:2.21.0.fuse-730078-redhat-00001]
      	at org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:406) [62:org.apache.camel.camel-core:2.21.0.fuse-730078-redhat-00001]
      	at org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:176) [62:org.apache.camel.camel-core:2.21.0.fuse-730078-redhat-00001]
      	at org.apache.camel.processor.Pipeline.process(Pipeline.java:138) [62:org.apache.camel.camel-core:2.21.0.fuse-730078-redhat-00001]
      	at org.apache.camel.processor.Pipeline.process(Pipeline.java:101) [62:org.apache.camel.camel-core:2.21.0.fuse-730078-redhat-00001]
      	at org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:548) [62:org.apache.camel.camel-core:2.21.0.fuse-730078-redhat-00001]
      	at org.apache.camel.spring.spi.TransactionErrorHandler.processByErrorHandler(TransactionErrorHandler.java:220) [72:org.apache.camel.camel-spring:2.21.0.fuse-730078-redhat-00001]
      	at org.apache.camel.spring.spi.TransactionErrorHandler.process(TransactionErrorHandler.java:101) [72:org.apache.camel.camel-spring:2.21.0.fuse-730078-redhat-00001]
      	at org.apache.camel.spring.spi.TransactionErrorHandler.process(TransactionErrorHandler.java:114) [72:org.apache.camel.camel-spring:2.21.0.fuse-730078-redhat-00001]
      	at org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:548) [62:org.apache.camel.camel-core:2.21.0.fuse-730078-redhat-00001]
      	at org.apache.camel.spring.spi.TransactionErrorHandler.processByErrorHandler(TransactionErrorHandler.java:220) [72:org.apache.camel.camel-spring:2.21.0.fuse-730078-redhat-00001]
      	at org.apache.camel.spring.spi.TransactionErrorHandler$1.doInTransactionWithoutResult(TransactionErrorHandler.java:183) [72:org.apache.camel.camel-spring:2.21.0.fuse-730078-redhat-00001]
      	at org.springframework.transaction.support.TransactionCallbackWithoutResult.doInTransaction(TransactionCallbackWithoutResult.java:34) [172:org.apache.servicemix.bundles.spring-tx:4.3.20.RELEASE_1]
      	at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:133) [172:org.apache.servicemix.bundles.spring-tx:4.3.20.RELEASE_1]
      	at org.apache.camel.spring.spi.TransactionErrorHandler.doInTransactionTemplate(TransactionErrorHandler.java:176) [72:org.apache.camel.camel-spring:2.21.0.fuse-730078-redhat-00001]
      	at org.apache.camel.spring.spi.TransactionErrorHandler.processInTransaction(TransactionErrorHandler.java:136) [72:org.apache.camel.camel-spring:2.21.0.fuse-730078-redhat-00001]
      	at org.apache.camel.spring.spi.TransactionErrorHandler.process(TransactionErrorHandler.java:105) [72:org.apache.camel.camel-spring:2.21.0.fuse-730078-redhat-00001]
      	at org.apache.camel.spring.spi.TransactionErrorHandler.process(TransactionErrorHandler.java:114) [72:org.apache.camel.camel-spring:2.21.0.fuse-730078-redhat-00001]
      	at org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:201) [62:org.apache.camel.camel-core:2.21.0.fuse-730078-redhat-00001]
      	at org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:201) [62:org.apache.camel.camel-core:2.21.0.fuse-730078-redhat-00001]
      	at org.apache.camel.component.timer.TimerConsumer.sendTimerExchange(TimerConsumer.java:197) [62:org.apache.camel.camel-core:2.21.0.fuse-730078-redhat-00001]
      	at org.apache.camel.component.timer.TimerConsumer$1.run(TimerConsumer.java:79) [62:org.apache.camel.camel-core:2.21.0.fuse-730078-redhat-00001]
      	at java.util.TimerThread.mainLoop(Timer.java:555) [?:?]
      	at java.util.TimerThread.run(Timer.java:505) [?:?]
      Caused by: java.io.StreamCorruptedException: invalid stream header: 31363430
      	at java.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java:857) ~[?:?]
      	at java.io.ObjectInputStream.<init>(ObjectInputStream.java:349) ~[?:?]
      	at org.apache.camel.processor.aggregate.jdbc.ClassLoadingAwareObjectInputStream.<init>(ClassLoadingAwareObjectInputStream.java:50) ~[233:org.apache.camel.camel-sql:2.21.0.fuse-730078-redhat-00001]
      	at org.apache.camel.processor.aggregate.jdbc.JdbcCamelCodec.decode(JdbcCamelCodec.java:87) ~[233:org.apache.camel.camel-sql:2.21.0.fuse-730078-redhat-00001]
      	at org.apache.camel.processor.aggregate.jdbc.JdbcCamelCodec.unmarshallExchange(JdbcCamelCodec.java:58) ~[233:org.apache.camel.camel-sql:2.21.0.fuse-730078-redhat-00001]
      	at org.apache.camel.processor.aggregate.jdbc.JdbcAggregationRepository$3.doInTransaction(JdbcAggregationRepository.java:290) ~[233:org.apache.camel.camel-sql:2.21.0.fuse-730078-redhat-00001]
      	... 31 more
      

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  oscerd Andrea Cosentino
                  Reporter:
                  hisao.furuichi Hisao Furuichi
                  Tester:
                  Tomas Turek
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  5 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: