Publicité
+ Répondre à la discussion
Affichage des résultats 1 à 2 sur 2
  1. #1
    Membre Expert Avatar de leminipouce
    Homme Profil pro Olivier
    Ingénieur développement logiciels
    Inscrit en
    janvier 2004
    Messages
    754
    Détails du profil
    Informations personnelles :
    Nom : Homme Olivier
    Âge : 30
    Localisation : France, Haute Garonne (Midi Pyrénées)

    Informations professionnelles :
    Activité : Ingénieur développement logiciels
    Secteur : Agroalimentaire - Agriculture

    Informations forums :
    Inscription : janvier 2004
    Messages : 754
    Points : 1 069
    Points
    1 069

    Par défaut [Camel] RequestBody avec plusieurs paramètres

    Bonjour à tous,

    Je ne suis pas bien sûr d'être dans le bon forum, mais je n'en trouve pas qui se rapproche de Camel... j'ai pensé qu'ici...Bref !

    J'ai un WS qui doit envoyer un message à Camel pour que celui-ci renvoie vers un service métier.
    Il s'agît d'un échange InOut.
    Le WS service reçoit 2 paramètres (que je lis sans problème) et doit les renvoyer tous les 2 au service métier via Camel.

    J'ai donc le code ci-dessous :
    Code :
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    			// Envoie du message à Camel pour redirection vers le service
    			// métier.
    			ProducerTemplate template = context.createProducerTemplate();
     
    			List<Object> params = new ArrayList<Object>();
    			params.add(10); 
    			params.add("toto");
     
    			result = template.requestBody("direct:metafluxMessage", // C'est ici la ligne des logs : fr.gouv.agriculture.metaflux.services.impl.MetafluxWSImpl.initTraitement(MetafluxWSImpl.java:61)
    					params, TraitementFluxGlobal.class);
    Avec la déclaration de route suivante :
    Code :
    1
    2
    3
    4
    5
    6
    				from("direct:metafluxMessage").to("direct:initTraitementGlobal");
    				// TODO utiliser l'interface ci-dessous. --> Voir comment
    				// utiliser Spring pour faire le mapping avec l'implémentation
    				from("direct:initTraitementGlobal").bean(
    						ServiceMetafluxImpl.class,
    						 "initTraitement(int, String)");
    Et la trace d'erreur suivante quand je passe sur "template.requestBody" :
    Code :
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
    157
    158
    159
    160
    161
    162
    163
    164
    165
    166
    167
    168
    169
    170
    171
    172
    173
    174
    175
    176
    177
    178
    179
    180
    181
    182
    183
    184
    185
    186
    187
    188
    189
    190
    191
    192
    193
    194
    195
    196
    197
    198
    199
    200
    201
    202
    203
    204
    205
    206
    207
    208
    209
    210
    211
    212
    213
    214
    215
    216
    217
    218
    219
    220
    221
    222
    223
    224
    225
    226
    227
    228
    229
    230
    231
    232
    233
    234
    235
    236
    237
    238
    239
    240
    241
    242
    243
    244
    245
    246
    247
    [#|2011-12-29T15:24:10.923+0100|INFO|glassfish3.1.1|javax.enterprise.system.std.com.sun.enterprise.server.logging|_Threa
    dID=19;_ThreadName=Thread-2;|15:24:10,923 ERROR DefaultErrorHandler:232 - Failed delivery for exchangeId: ID-AUZ-S111024
    -01-4361-1325168614158-0-1. Exhausted after delivery attempt: 1 caught: java.lang.IllegalArgumentException
    java.lang.IllegalArgumentException
            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
            at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
            at java.lang.reflect.Method.invoke(Method.java:597)
            at org.apache.camel.component.bean.MethodInfo.invoke(MethodInfo.java:329)
            at org.apache.camel.component.bean.MethodInfo$1.proceed(MethodInfo.java:231)
            at org.apache.camel.component.bean.BeanProcessor.process(BeanProcessor.java:169)
            at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:78)
            at org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:98)
            at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:89)
            at org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:69)
            at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:78)
            at org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:98)
            at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:89)
            at org.apache.camel.processor.interceptor.TraceInterceptor.process(TraceInterceptor.java:99)
            at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:78)
            at org.apache.camel.processor.RedeliveryErrorHandler.processErrorHandler(RedeliveryErrorHandler.java:318)
            at org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:209)
            at org.apache.camel.processor.DefaultChannel.process(DefaultChannel.java:305)
            at org.apache.camel.processor.UnitOfWorkProcessor.process(UnitOfWorkProcessor.java:132)
            at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:78)
            at org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:98)
            at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:89)
            at org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:69)
            at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:78)
            at org.apache.camel.component.direct.DirectProducer.process(DirectProducer.java:61)
            at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:78)
            at org.apache.camel.processor.SendProcessor$2.doInAsyncProducer(SendProcessor.java:114)
            at org.apache.camel.impl.ProducerCache.doInAsyncProducer(ProducerCache.java:284)
            at org.apache.camel.processor.SendProcessor.process(SendProcessor.java:109)
            at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:78)
            at org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:98)
            at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:89)
            at org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:69)
            at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:78)
            at org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:98)
            at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:89)
            at org.apache.camel.processor.interceptor.TraceInterceptor.process(TraceInterceptor.java:99)
            at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:78)
            at org.apache.camel.processor.RedeliveryErrorHandler.processErrorHandler(RedeliveryErrorHandler.java:318)
            at org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:209)
            at org.apache.camel.processor.DefaultChannel.process(DefaultChannel.java:305)
            at org.apache.camel.processor.UnitOfWorkProcessor.process(UnitOfWorkProcessor.java:132)
            at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:78)
            at org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:98)
            at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:89)
            at org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:69)
            at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:78)
            at org.apache.camel.component.direct.DirectProducer.process(DirectProducer.java:61)
            at org.apache.camel.processor.UnitOfWorkProcessor.process(UnitOfWorkProcessor.java:102)
            at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:104)
            at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:85)
            at org.apache.camel.processor.UnitOfWorkProducer.process(UnitOfWorkProducer.java:63)
            at org.apache.camel.impl.ProducerCache$2.doInProducer(ProducerCache.java:351)
            at org.apache.camel.impl.ProducerCache$2.doInProducer(ProducerCache.java:323)
            at org.apache.camel.impl.ProducerCache.doInProducer(ProducerCache.java:222)
            at org.apache.camel.impl.ProducerCache.sendExchange(ProducerCache.java:323)
            at org.apache.camel.impl.ProducerCache.send(ProducerCache.java:185)
            at org.apache.camel.impl.DefaultProducerTemplate.send(DefaultProducerTemplate.java:114)
            at org.apache.camel.impl.DefaultProducerTemplate.sendBody(DefaultProducerTemplate.java:118)
            at org.apache.camel.impl.DefaultProducerTemplate.sendBody(DefaultProducerTemplate.java:135)
            at org.apache.camel.impl.DefaultProducerTemplate.requestBody(DefaultProducerTemplate.java:283)
            at org.apache.camel.impl.DefaultProducerTemplate.requestBody(DefaultProducerTemplate.java:313)
            at fr.gouv.agriculture.metaflux.services.impl.MetafluxWSImpl.initTraitement(MetafluxWSImpl.java:61)
            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
            at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
            at java.lang.reflect.Method.invoke(Method.java:597)
            at com.sun.xml.ws.api.server.InstanceResolver$1.invoke(InstanceResolver.java:250)
            at com.sun.xml.ws.server.InvokerTube$2.invoke(InvokerTube.java:150)
            at com.sun.xml.ws.server.sei.EndpointMethodHandler.invoke(EndpointMethodHandler.java:261)
            at com.sun.xml.ws.server.sei.SEIInvokerTube.processRequest(SEIInvokerTube.java:100)
            at com.sun.xml.ws.api.pipe.Fiber.__doRun(Fiber.java:641)
            at com.sun.xml.ws.api.pipe.Fiber._doRun(Fiber.java:600)
            at com.sun.xml.ws.api.pipe.Fiber.doRun(Fiber.java:585)
            at com.sun.xml.ws.api.pipe.Fiber.runSync(Fiber.java:482)
            at com.sun.xml.ws.server.WSEndpointImpl$2.process(WSEndpointImpl.java:314)
            at com.sun.xml.ws.transport.http.HttpAdapter$HttpToolkit.handle(HttpAdapter.java:608)
            at com.sun.xml.ws.transport.http.HttpAdapter.handle(HttpAdapter.java:259)
            at com.sun.xml.ws.transport.http.servlet.ServletAdapter.invokeAsync(ServletAdapter.java:213)
            at com.sun.xml.ws.transport.http.servlet.WSServletDelegate.doGet(WSServletDelegate.java:159)
            at com.sun.xml.ws.transport.http.servlet.WSServletDelegate.doPost(WSServletDelegate.java:194)
            at com.sun.xml.ws.transport.http.servlet.WSServlet.doPost(WSServlet.java:80)
            at javax.servlet.http.HttpServlet.service(HttpServlet.java:754)
            at javax.servlet.http.HttpServlet.service(HttpServlet.java:847)
            at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1539)
            at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:281)
            at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
            at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:655)
            at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:595)
            at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:98)
            at com.sun.enterprise.web.PESessionLockingStandardPipeline.invoke(PESessionLockingStandardPipeline.java:91)
            at org.apache.catalina.core.StandardHo|#]
     
    [#|2011-12-29T15:24:10.923+0100|INFO|glassfish3.1.1|javax.enterprise.system.std.com.sun.enterprise.server.logging|_Threa
    dID=19;_ThreadName=Thread-2;|stValve.invoke(StandardHostValve.java:162)
            at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:330)
            at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:231)
            at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:174)
            at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:828)
            at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:725)
            at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1019)
            at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:225)
            at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137)
            at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104)
            at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90)
            at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79)
            at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54)
            at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59)
            at com.sun.grizzly.ContextTask.run(ContextTask.java:71)
            at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532)
            at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513)
            at java.lang.Thread.run(Thread.java:619)
    |#]
     
    [#|2011-12-29T15:24:10.939+0100|INFO|glassfish3.1.1|javax.enterprise.system.std.com.sun.enterprise.server.logging|_Threa
    dID=19;_ThreadName=Thread-2;|15:24:10,939 ERROR MetafluxWSImpl:72 - Exception lors de l'initTraitement d'un flux global.
     
            Cause : java.lang.IllegalArgumentException
             Message : Exception occurred during execution on the exchange: Exchange[Message: [12, tre]]
    |#]
     
    [#|2011-12-29T15:24:10.939+0100|SEVERE|glassfish3.1.1|com.sun.xml.ws.server.sei.EndpointMethodHandler|_ThreadID=19;_Thre
    adName=Thread-2;|Exception occurred during execution on the exchange: Exchange[Message: [12, tre]]
    org.apache.camel.CamelExecutionException: Exception occurred during execution on the exchange: Exchange[Message: [12, tr
    e]]
            at org.apache.camel.util.ObjectHelper.wrapCamelExecutionException(ObjectHelper.java:1161)
            at org.apache.camel.util.ExchangeHelper.extractResultBody(ExchangeHelper.java:512)
            at org.apache.camel.impl.DefaultProducerTemplate.extractResultBody(DefaultProducerTemplate.java:441)
            at org.apache.camel.impl.DefaultProducerTemplate.sendBody(DefaultProducerTemplate.java:119)
            at org.apache.camel.impl.DefaultProducerTemplate.sendBody(DefaultProducerTemplate.java:135)
            at org.apache.camel.impl.DefaultProducerTemplate.requestBody(DefaultProducerTemplate.java:283)
            at org.apache.camel.impl.DefaultProducerTemplate.requestBody(DefaultProducerTemplate.java:313)
            at fr.gouv.agriculture.metaflux.services.impl.MetafluxWSImpl.initTraitement(MetafluxWSImpl.java:61)
            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
            at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
            at java.lang.reflect.Method.invoke(Method.java:597)
            at com.sun.xml.ws.api.server.InstanceResolver$1.invoke(InstanceResolver.java:250)
            at com.sun.xml.ws.server.InvokerTube$2.invoke(InvokerTube.java:150)
            at com.sun.xml.ws.server.sei.EndpointMethodHandler.invoke(EndpointMethodHandler.java:261)
            at com.sun.xml.ws.server.sei.SEIInvokerTube.processRequest(SEIInvokerTube.java:100)
            at com.sun.xml.ws.api.pipe.Fiber.__doRun(Fiber.java:641)
            at com.sun.xml.ws.api.pipe.Fiber._doRun(Fiber.java:600)
            at com.sun.xml.ws.api.pipe.Fiber.doRun(Fiber.java:585)
            at com.sun.xml.ws.api.pipe.Fiber.runSync(Fiber.java:482)
            at com.sun.xml.ws.server.WSEndpointImpl$2.process(WSEndpointImpl.java:314)
            at com.sun.xml.ws.transport.http.HttpAdapter$HttpToolkit.handle(HttpAdapter.java:608)
            at com.sun.xml.ws.transport.http.HttpAdapter.handle(HttpAdapter.java:259)
            at com.sun.xml.ws.transport.http.servlet.ServletAdapter.invokeAsync(ServletAdapter.java:213)
            at com.sun.xml.ws.transport.http.servlet.WSServletDelegate.doGet(WSServletDelegate.java:159)
            at com.sun.xml.ws.transport.http.servlet.WSServletDelegate.doPost(WSServletDelegate.java:194)
            at com.sun.xml.ws.transport.http.servlet.WSServlet.doPost(WSServlet.java:80)
            at javax.servlet.http.HttpServlet.service(HttpServlet.java:754)
            at javax.servlet.http.HttpServlet.service(HttpServlet.java:847)
            at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1539)
            at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:281)
            at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
            at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:655)
            at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:595)
            at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:98)
            at com.sun.enterprise.web.PESessionLockingStandardPipeline.invoke(PESessionLockingStandardPipeline.java:91)
            at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:162)
            at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:330)
            at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:231)
            at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:174)
            at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:828)
            at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:725)
            at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1019)
            at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:225)
            at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137)
            at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104)
            at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90)
            at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79)
            at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54)
            at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59)
            at com.sun.grizzly.ContextTask.run(ContextTask.java:71)
            at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532)
            at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513)
            at java.lang.Thread.run(Thread.java:619)
    Caused by: java.lang.IllegalArgumentException
            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
            at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
            at java.lang.reflect.Method.invoke(Method.java:597)
            at org.apache.camel.component.bean.MethodInfo.invoke(MethodInfo.java:329)
            at org.apache.camel.component.bean.MethodInfo$1.proceed(MethodInfo.java:231)
            at org.apache.camel.component.bean.BeanProcessor.process(BeanProcessor.java:169)
            at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:78)
            at org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:98)
            at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:89)
            at org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:69)
            at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:78)
            at org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:98)
            at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:89)
            at org.apache.camel.processor.interceptor.TraceInterceptor.process(TraceInterceptor.java:99)
            at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:78)
            at org.apache.camel.processor.RedeliveryErrorHandler.processErrorHandler(RedeliveryErrorHandler.java:318)
            at org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:209)
            at org.apache.camel.processor.DefaultChannel.process(DefaultChannel.java:305)
            at org.apache.camel.processor.UnitOfWorkProcessor.process(UnitOfWorkProcessor.java:132)
            at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:78)
            at org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:98)
            at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:89)
            at org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:69)
            at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:78)
            at org.apache.camel.component.direct.DirectProducer.process(DirectProducer.java:61)
            at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:78)
            at org.apache.camel.processor.SendProcessor$2.doInAsyncProducer(SendProcessor.java:114)
            at org.apache.camel.impl.ProducerCache.doInAsyncProducer(ProducerCache.java:284)
            at org.apache.camel.processor.SendProcessor.process(SendProcessor.java:109)
            at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:78)
            at org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:98)
            at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:89)
            at org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:69)
            at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:78)
            at org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:98)
            at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:89)
            at org.apache.camel.processor.interceptor.TraceInterceptor.process(TraceInterceptor.java:99)
            at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:78)
            at org.apache.camel.processor.RedeliveryErrorHandler.processErrorHandler(RedeliveryErrorHandler.java:318)
            at org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:209)
            at org.apache.camel.processor.DefaultChannel.process(DefaultChannel.java:305)
            at org.apache.camel.processor.UnitOfWorkProcessor.process(UnitOfWorkProcessor.java:132)
            at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:78)
            at org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:98)
            at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:89)
            at org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:69)
            at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:78)
            at org.apache.camel.component.direct.DirectProducer.process(DirectProducer.java:61)
            at org.apache.camel.processor.UnitOfWorkProcessor.process(UnitOfWorkProcessor.java:102)
            at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:104)
            at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:85)
            at org.apache.camel.processor.UnitOfWorkProducer.process(UnitOfWorkProducer.java:63)
            at org.apache.camel.impl.ProducerCache$2.doInProducer(ProducerCache.java:351)
            at org.apache.camel.impl.ProducerCache$2.doInProducer(ProducerCache.java:323)
            at org.apache.camel.impl.ProducerCache.doInProducer(ProducerCache.java:222)
            at org.apache.camel.impl.ProducerCache.sendExchange(ProducerCache.java:323)
            at org.apache.camel.impl.ProducerCache.send(ProducerCache.java:185)
            at org.apache.camel.impl.DefaultProducerTemplate.send(DefaultProducerTemplate.java:114)
            at org.apache.camel.impl.DefaultProducerTemplate.sendBody(DefaultProducerTemplate.java:118)
            ... 50 more
    |#]
    Bien sûr, si je ne passe qu'un seul paramètre à Camel, donc sans la liste, et que mon service métier n'attend qu'un seul paramètre (String ou int, peu importe), tout marche, et j'ai bien mon aller-retour.

    J'ai un peu du mal à comprendre, d'autant que l'idée de la liste vient directement du livre "Camel in Action", rédigé par les développeurs de Camel !

    Bref, si l'un de vous a des idées pour m'aider à avancer sur le sujet, je suis preneur.

    Par avance, Merci.
    Si , et la ont échoué mais pas nous, pensez à dire et cliquez sur . Merci !

    Ici, c'est un forum, pas une foire. Il y a de respectables règles... à respecter !

  2. #2
    Membre Expert Avatar de leminipouce
    Homme Profil pro Olivier
    Ingénieur développement logiciels
    Inscrit en
    janvier 2004
    Messages
    754
    Détails du profil
    Informations personnelles :
    Nom : Homme Olivier
    Âge : 30
    Localisation : France, Haute Garonne (Midi Pyrénées)

    Informations professionnelles :
    Activité : Ingénieur développement logiciels
    Secteur : Agroalimentaire - Agriculture

    Informations forums :
    Inscription : janvier 2004
    Messages : 754
    Points : 1 069
    Points
    1 069

    Par défaut Solution

    Bon...

    J'ai pas trouvé la solution exacte au problème, mais j'ai au moins trouvé un contournement qui me semble propre.
    Donc si ça peut aider quelqu'un...

    Voici la déclaration d'une route (notez que je renvoie vers une méthode qui attend pour seul et unique paramètre un Message)
    Code :
    1
    2
    3
    		// Route pour l'initialisation des traitements élémentaires
    		from(CamelRoutes.DIRECT_INIT_TRAITEMENT_ELEMENTAIRE.getRouteUri()).to(
    				BEAN_SERVICE_METAFLUX + METHOD + "initTraitement(Message)");
    Et voici la méthode du bean vers lequel est effectué la redirection :
    Code :
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    	/**
    	 * @see fr.gouv.agriculture.metaflux.services.ServiceMetaflux#initTraitement(Exchange)
    	 */
    	public TraitementFluxElementaire initTraitement(Message messageIn)
    			throws TraitementUnknownException,
    			TraitementNotElementaireException, TraitementNotRunningException {
    		LOGGER.trace("Initialisation du traitement elementaire");
     
    		@SuppressWarnings("unchecked")
    		Map<MessageParams, Object> params = messageIn.getBody(Map.class);
    		int idFluxElementaire = (Integer) params
    				.get(MessageParams.ID_FLUX_ELEMENTAIRE);
    		TraitementFluxGlobal traitementFluxGlobal = (TraitementFluxGlobal) params
    				.get(MessageParams.TRAITEMENT_FLUX_GLOBAL);
     
    		LOGGER.trace("\tTraitement elementaire n°" + idFluxElementaire
    				+ "\n\tTraitement global parent n°"
    				+ traitementFluxGlobal.getIdFlux());
     
    		// TODO Supprimer ce bouchon pour faire quelque chose d'utile
    		TraitementFluxElementaire traitementFluxElementaire = new TraitementFluxElementaire(
    				idFluxElementaire, 2 * idFluxElementaire, traitementFluxGlobal);
    		traitementFluxGlobal.getListeFluxElementaires().add(
    				traitementFluxElementaire);
     
    		LOGGER.info("Fin d'initialisation du traitement elementaire n°"
    				+ idFluxElementaire);
    		return traitementFluxElementaire;
    	}
    Les paramètres sont récupérés dans une Map qui est le "body" de mon "org.apache.camel.Message".

    En espérant que ça aidera...
    Si , et la ont échoué mais pas nous, pensez à dire et cliquez sur . Merci !

    Ici, c'est un forum, pas une foire. Il y a de respectables règles... à respecter !

+ Répondre à la discussion
Cette discussion est résolue.

Liens sociaux

Règles de messages

  • Vous ne pouvez pas créer de nouvelles discussions
  • Vous ne pouvez pas envoyer des réponses
  • Vous ne pouvez pas envoyer des pièces jointes
  • Vous ne pouvez pas modifier vos messages
  •