Hi,
I am trying to build a camel route that sends messages from a ActiveMQ Queue to 
Iota Tangle. The route is working, however when I try to simulate that tangle 
is unavailable, the exception is not handled by the DoTry /DoCatch and thus is 
thrown.
My understanding is that the Exception is thrown in Iota class which has its 
own error handling. Then additionally an IllegalStateException is thrown which 
is handled by DoTry.
Do you have any ideas what I might do to enforce the original error being 
handled by DOTry or at least that the exception is not thrown?
The exception is thrown in the .to("iota..." line

Here are some details about my project that might help you:

Camel version: 3.7.2.
Spring Boot version 2.4.1

from("activemq:queue:Projektarbeit").doTry()

                     // im msg body String message = "{hello world}";

                     .setHeader("CamelIOTAToAddress", constant(
                          
"MMNDD9DWUEVKEIVHFAOMHISHXJSGXWBJFYEQPOQKSVGZZFLTUUPBACNQZTAKXR9TFVKBGYSNSPHRNKKHAPEIEHYEAX"))
                     .setHeader("CamelIOTASeed",
                          
constant("NWNWJDBYZG9EVPDHENEAABRHSQJNIZFPRMPAWUBZV9LVKPJTVSQNFKKNLBOQMGWVZLCKHVOLQJDYAV9JN"))
                     .setHeader("CamelIOTAValue", constant(0))
                     // split message into Iota size
                     .process(new Processor() {
                          public void process(Exchange exchange) {
                               String message = 
exchange.getIn().getBody(String.class);
                               slicer.slice(message);
                          };
                     }).process(new Processor() {

                          @Override
                          public void process(Exchange exchange) {
                               // TODO Auto-generated method stub
                               throw new RuntimeException("runtime");
                          }

                     })

                     // message -> iota //depth standard is 3
                     
.to("iota:good?url=https://nodes.thetangle.org:443&operation=sendTransfer&tag=DDXCRCZCTCFDHD9999999999999&depth=4&minWeightMagnitude=14&securityLevel=1";)
                     .doCatch(Exception.class).process(new Processor() {
                          public void process(Exchange exchange) {
                               final Throwable ex = 
exchange.getProperty(Exchange.EXCEPTION_CAUGHT, Throwable.class);

                               String message = " " + 
exchange.getIn().getBody(String.class);
                               
exchange.getIn().setBody(ex.getClass().getCanonicalName() + message);
                          };
                     }).to("activemq:queue:UnserTest").stop()



Thanks for your help


Best Regards

Nils Wendland
[Ein Bild, das Person, Text, Schild, Frau enthält.  Automatisch generierte 
Beschreibung]<https://www.pickert.de/rqm61>  
[cid:image002.jpg@01D70E7B.4C5F28B0] 
<https://www.pickert.de/produktuebersicht-idos/>

Geschäftsführer: Sven O. Rimmelspacher
Amtsgericht Mannheim HRB 104443
USt-ID: DE143555026


Reply via email to