Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    elbaz michael
    @mikadev
    @omarsmak stop answer me this kind of please i know all of it we already discuss about this is your code ? if yes why you don't check by yourself that it doesn't work
    i unfortunately doesn't have the time to rewrite this component before camel 3.0.0 there was a deprecated arguments that just working until someone come and rewrite this new bugged version and now with camel 3 this option was removed this is reliable you think i'm not sorry
    Omar Al-Safi
    @omarsmak
    @mikadev we are community of users who treat each other with respect and understanding, everyone here will try to help each other.
    so I would apperciate if you are respecting eveyone in this room
    elbaz michael
    @mikadev
    i'm respecting everyone but i don't think answering me read the doc or something like help for something
    @omarsmak if you know the code of this component maybe we can rewrite this one together ?
    Jean-Baptiste Onofré
    @jbonofre
    @mikadev is it a regression in Camel 3.0.x ?
    elbaz michael
    @mikadev
    @jbonofre not exactly before Camel 3.0 there was a deprecated parameter that simply do the job the real regression was make by developer that deprecate this simple map parameter and try to do something more generic that simply not working and can't cover all the rabbitMQ options i'm alerting about this one for years ago
    Jean-Baptiste Onofré
    @jbonofre
    @mikadev I see. So, you are proposing to pass RabbitMQ options via the URI or a config bean ?
    Andrea Cosentino
    @oscerd
    @mikadev you didn't alert while the PR was open and I don't remember any comment from you.
    elbaz michael
    @mikadev
    You right i'm alerting after it was merged and until know i use the deprecated parameter
    onlybytes
    @onlybytes

    Hi,
    Would like to hear experts thoughts. My use case is:
    Listen to a RabbitMQ queue/topic, get the message, process it, send it to other message broker (RabbitMQ/ActiveMQ).

    Expected load: 5000 messages/sec

    This is first time I am using Apache Camel. I did some POCs to learn the basics and all is ok.

    Now the question is: Apache Camel Vs Spring Integration - Which framework to choose?

    Please let me know your expert views on: Performance, Easy of Maintenance, and extensibility.

    I am yet to do a POC using Spring Integration. Thought of checking with experts here while i am working on my POC

    Thanks in advance.

    elbaz michael
    @mikadev
    @onlybytes My opinion after year in this domain there is no equivalent to apache Camel this day its just rock, i was also trying Spring integration and the inbound outbound in every line and the dsl make me more sure about Camel choice. About maintenance is like the others Framework and technologies if you choose to apply the guidelines and good design patterns everything will be good
    onlybytes
    @onlybytes
    @mikadev thanks a lot for your response. I have one more question since you mentioned DSL. How about Spring Cloud Stream? The authors claim that its simplified and scalable. Its kind of like Spring Boot+Spring Integration.
    Once again thanks for taking time to respond to my query
    Omar Al-Safi
    @omarsmak
    @onlybytes IMO, is hard to tell which is better which is not. For me, is pretty much down to your requirements, for example, if you know that you will need to apply EIP on your pipeline, e.g: enriching, message routing, make use of different components downstream ..etc, Camel would be a perfect fit. In the other hand, if you, for example, are going with RabbitMQ/ActiveMQ for now and then let’s say requirements changed later and you need to change to Kafka, assuming you have built your business logic on top of it, with Spring Cloud Stream, is an ease to change the bindings from RabbitMQ to Kafka without much of worries.
    However, one could argue that you can also achive that in Camel as well with ease which is true.
    onlybytes
    @onlybytes
    @omarsmak thanks for the insights.
    yvendruscolo
    @yvendruscolo
    hello, I am having a weird issue while exploring camel, is this the place for newbie questions too?
    elbaz michael
    @mikadev
    Hello i'm getting this exception using camel 3 Error executing reactive work due to AllowUseOriginalMessage is disabled. Cannot access the original message.. This exception is ignored even after doing this getContext().setAllowUseOriginalMessage(true) (using spring boot container)
    Omar Al-Safi
    @omarsmak
    @yvendruscolo sure, feel free to ask
    Omid Dehghan
    @odchan1_twitter
    @yvendruscolo any Camelish humpy bumpy questions are welcomed here :))
    Omar Al-Safi
    @omarsmak
    @odchan1_twitter lol
    yvendruscolo
    @yvendruscolo

    nice :)
    so, I have this simple router:

            from("file://OUT")
            .convertBodyTo(String.class)
            .process()
                .message(m -> m.setBody(
                    "from " 
                    + m.getHeader("CamelFileName", String.class)
                    + ": "
                    + m.getBody()))
            .to("stream:out");

    when I try to run it via mvn exec:java, it works out great, but when I try to build a fat jar and run it, I get this:

    org.apache.camel.InvalidPayloadException: No body available of type: java.lang.String but has value: GenericFile[ID-PC-002148-1575466370342-0-2] of type: org.apache.camel.component.file.GenericFile on: ID-PC-002148-1575466370342-0-2. Caused by: No type converter available to convert from type: org.apache.camel.component.file.GenericFile to the required type: java.lang.String with value GenericFile[ID-PC-002148-1575466370342-0-2]. Exchange[ID-PC-002148-1575466370342-0-11]. Caused by: [org.apache.camel.NoTypeConversionAvailableException - No type converter available to convert from type: org.apache.camel.component.file.GenericFile to the required type: java.lang.String with value GenericFile[ID-PC-002148-1575466370342-0-2]]

    any ideas? (im also a java newbie, sorry)

    I also tried m.getBody(String.class) but it always brings back null, even if file exists and has content
    if that's not actually camel related, can I get pointed to a maven helping group? (camel is my first experience with java)
    Adrian Soria
    @adrianSoria
    @yvendruscolo seems like you cannot convert a GenericFile to String in an .convertBodyTo. You can try a custom processor and do it with Java there
    Adrian Soria
    @adrianSoria
    I think you stream the file with the camel "file" endpoint
    Jan Bednar
    @bedlaj
    @yvendruscolo can you share your pom.xml? There is converter from GenericFile to String in camel-file package, so it was somehow excluded in your fat jar.
    yvendruscolo
    @yvendruscolo
    <?xml version="1.0" encoding="UTF-8"?>
    <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
             xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
    
      <modelVersion>4.0.0</modelVersion>
    
      <groupId>pocamel</groupId>
      <artifactId>pocamel</artifactId>
      <packaging>jar</packaging>
      <version>1.0-SNAPSHOT</version>
    
      <name>A Camel Route</name>
    
      <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
      </properties>
    
      <dependencyManagement>
        <dependencies>
          <!-- Camel BOM -->
          <dependency>
            <groupId>org.apache.camel</groupId>
            <artifactId>camel-parent</artifactId>
            <version>3.0.0</version>
            <scope>import</scope>
            <type>pom</type>
          </dependency>
        </dependencies>
      </dependencyManagement>
    
      <dependencies>
    
        <!-- apache camel -->
        <dependency>
          <groupId>org.apache.camel</groupId>
          <artifactId>camel-core</artifactId>
        </dependency>
        <dependency>
          <groupId>org.apache.camel</groupId>
          <artifactId>camel-main</artifactId>
        </dependency>
    
        <!-- camel components -->
        <dependency>
            <groupId>org.apache.camel</groupId>
            <artifactId>camel-stream</artifactId>
            <version>3.0.0</version>
        </dependency>
    
        <!-- logging -->
        <dependency>
          <groupId>org.apache.logging.log4j</groupId>
          <artifactId>log4j-api</artifactId>
          <scope>runtime</scope>
        </dependency>
        <dependency>
          <groupId>org.apache.logging.log4j</groupId>
          <artifactId>log4j-core</artifactId>
          <scope>runtime</scope>
        </dependency>
        <dependency>
          <groupId>org.apache.logging.log4j</groupId>
          <artifactId>log4j-slf4j-impl</artifactId>
          <scope>runtime</scope>
        </dependency>
    
        <!-- testing -->
        <dependency>
          <groupId>org.apache.camel</groupId>
          <artifactId>camel-test</artifactId>
          <scope>test</scope>
        </dependency>
      </dependencies>
    
      <build>
        <defaultGoal>install</defaultGoal>
    
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>3.8.1</version>
            <configuration>
              <source>1.8</source>
              <target>1.8</target>
            </configuration>
          </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-resources-plugin</artifactId>
            <version>3.1.0</version>
            <configuration>
              <encoding>UTF-8</encoding>
            </configuration>
          </plugin>
    
          <!-- Allows the example to be run via 'mvn compile exec:java' -->
          <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>exec-maven-plugin</artifactId>
            <version>1.6.0</version>
            <configuration>
              <mainClass>pocamel.MainApp</mainClass>
              <includePluginDependencies>true</includePluginDependencies>
            </configuration>
          </plugin>
    
          <plugin>
              <groupId>org.apache.maven.plugins</groupId>
              <artifactId>maven-assembly-plugin</artifactId>
              <version>3.2.0</version>
              <executions>
                  <execution>
                      <id>make-assembly</id>
                      <phase>package</phase>
                      <goals> <goal>single</goal> </goals>
                      <configuration>
                          <archive>
                              <manifest>
                                  <mainClass>pocamel.MainApp</mainClass>
                              </manifest>
                          </archive>
                          <descriptorRefs>
                              <descriptorRef>jar-with-dependencies</descriptorRef>
                          </descriptorRefs>
                      </configuration>
                  </execution>
              </executions>
          </plugin>
    
        </plugins>
      </build>
    
    </project>
    @adrianSoria the weird thing is that via mvn exec:java it works
    Dragas
    @Dragas
    So how does adviceWith work in camel routes when mocking them
    Does it cause the endpoint to return what ever was sent to it as a body?
    I get an error that No type converter for OutputBody.class from InputBody.class when using ProducerTemplate#requestBody(String, Object, Class<OutputBody>)
    yvendruscolo
    @yvendruscolo
    @bedlaj i switched to gradle and it worked, so it was probably a problem in my pom file. i believe i can handle a gradle file better
    Jan Bednar
    @bedlaj
    @yvendruscolo Great! I am still looking on this, because maven-assembly-plugin in not working well with camel-main, because it overrides some important META-INF entries. I think we need to document this on website. Currently I found a working way using maven-shade-plugin instead of maven-assembly-plugin and some custom transformation of TypeConverterLoader entry.
    <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-shade-plugin</artifactId>
        <version>1.7</version>
        <executions>
            <execution>
                <phase>package</phase>
                <goals>
                    <goal>shade</goal>
                </goals>
                <configuration>
                    <!-- Optional Start -->
                    <shadedArtifactAttached>true</shadedArtifactAttached>
                    <shadedClassifierName>jar-with-dependencies</shadedClassifierName>
                    <!-- Optional End -->
                    <transformers>
                        <transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
                            <mainClass>pocamel.MainApp</mainClass>
                        </transformer>
                        <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
                            <resource>META-INF/services/org/apache/camel/TypeConverterLoader</resource>
                        </transformer>
                    </transformers>
                </configuration>
            </execution>
        </executions>
    </plugin>
    Jan Bednar
    @bedlaj
    yvendruscolo
    @yvendruscolo
    cool cool cool!
    yvendruscolo
    @yvendruscolo
    @bedlaj just a heads up, that did solve the issue too!
    Julia248
    @Julia248

    Im testing Camel Routes using JUnit5 and would like to run them in parallel . Therefore, I added

    junit.jupiter.execution.parallel.enabled = true junit.jupiter.execution.parallel.mode.default = concurrent junit.jupiter.execution.parallel.mode.classes.default = same_thread junit.jupiter.execution.parallel.config.strategy=fixed junit.jupiter.execution.parallel.config.fixed.parallelism=2

    into junit-plattform.properties.

    First question: as far as I understood, that was all I had to do. Is this correct? Im wondering because it does not immensely improve the runtime of my tests.

    Some some tests classes only run without any error if I set junit.jupiter.execution.parallel.config.fixed.parallelism = 1. Higher numbers will execute only one test of a class successfully, and then throw the following errors:

    • when using CamelSpringTestSupport
      :org.apache.camel.RuntimeCamelException: java.net.BindException: Address already in use Caused by: java.net.BindException: Address already in use

    or

    • when using SpringBootTest AND when at the same time I need to reload the camel context after each test with @DirtiesContext
      org.apache.camel.FailedToStartRouteException: Failed to start route route4 because of Multiple consumers for the same endpoint is not allowed: direct://start

    In test classes where I do not have to reload the context, no error occurs.

    Julia248
    @Julia248
    For the problem I described above, I try to give a random port to each test, but fail on the implementation of it. Anyone has an idea on how to do it?
    Luca Burgazzoli
    @lburgazzoli
    there's an AvailabePortFinder utility provided by camel
    should be part of camel-test*
    Julia248
    @Julia248

    @lburgazzoli Thanks for this advice :) I can't find an example on how to use this random port for the tests. I guess it happens together with loading the camel context, so I tried the following without luck:

    I changed this

    @Override
    protected AbstractApplicationContext createApplicationContext() {
    return new ClassPathXmlApplicationContext("camel-context.xml");
    }

    into this

    @Override
    protected AbstractApplicationContext createApplicationContext() {
    int port = AvailablePortFinder.getNextAvailable();
    System.setProperty("service.port", String.valueOf(port));
    System.setProperty("server.port", String.valueOf(port));
    ClassPathXmlApplicationContext ctx = new ClassPathXmlApplicationContext("camel-context.xml");
    return ctx;
    }

    My next try would be to use custom functions as described on the bottom of this page:
    https://camel.apache.org/manual/latest/using-propertyplaceholder.html

    elbaz michael
    @mikadev
    Apache camel website is down
    Omar Al-Safi
    @omarsmak
    it is working fine now I think
    elbaz michael
    @mikadev
    Oh nice update !
    elbaz michael
    @mikadev
    is very fast responding now