Giter VIP home page Giter VIP logo

camelinaction / camelinaction2 Goto Github PK

View Code? Open in Web Editor NEW
610.0 72.0 401.0 5.47 MB

:camel: This project hosts the source code for the examples of the Camel in Action 2nd ed book :closed_book: written by Claus Ibsen and Jonathan Anstey.

Home Page: https://www.manning.com/books/camel-in-action-second-edition

License: Apache License 2.0

Java 97.18% HTML 1.31% JavaScript 1.50% Shell 0.01%
camel book java apache-camel microservice integration eip

camelinaction2's Introduction

Camel in Action 2nd Edition

This project hosts the source code for the examples of the Camel in Action 2nd edition book written by Claus Ibsen and Jonathan Anstey.

Camel in Action 2nd ed cover

Table of Contents

Part 1 - First Steps

Part 2 - Core Camel

Part 3 - Developing and testing

Part 4 - Going further with Camel

Part 5 - Running and managing Camel

Part 6 - Out in the Wild

Bonus Chapters

  • 20 Reactive Camel
  • 21 Camel and the IoT by Henryk Konsek (has no source code)

Appendixes

  • A Simple, the expression language
  • B The Camel community

Downloading the source code

You can either download a .zip with all the source code from the releases page, or use the github way of cloning the repository on your computer.

System requirements

You need JDK 8 installed on your system in order to compile the source code.
Maven version >= 3.5.
Apache Camel 2.20.1 or newer 2.x version.

Camel 3.x support is not on the main branch, but provided as best effort on dedicated branches

Up to date source code

We the authors, intended to keep this source code up to date with future releases of Apache Camel. Giving our readers the best experience with the book and using the latest Camel releases.

Errata

Any mistakes in the book can be reported to us via github issues tracker. The errata can be viewed here

Getting in touch

To get in touch with the us the authors you can:

Happy reading and riding the Camel.

Claus Ibsen, and Jonathan Anstey

camelinaction2's People

Contributors

apupier avatar bvahdat avatar christophd avatar coyotesqrl avatar davsclaus avatar driekken avatar grgrzybek avatar janstey avatar jialigit avatar kevinearls avatar lburgazzoli avatar littleentity avatar mebanzon avatar monota avatar ooxi avatar scranton avatar swapy avatar willemjiang avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

camelinaction2's Issues

Turn on fastMode by default for VertX examples and cleanup display

Except for serious drinkers, I think it makes for a better demo if we turn fastMode on for the chapter7 vertx example, and add it for the vertx-camel example.

At the same time it would be nice to update the display by adding :00 to gametime, as this would make it look more like a real scoreboard, and after a goal is scored put the updated score on one line.

Chapter 2 - Failure in unit test

Running camelinaction.FtpToJMSWithDynamicToTest

2016-12-23 13:23:22,773 [file://src/data] ERROR DefaultErrorHandler            - Failed delivery for (MessageId: ID-davsclaus-air-50597-1482495800323-0-1 on ExchangeId: ID-davsclaus-air-50597-1482495800323-0-2). Exhausted after delivery attempt: 1 caught: java.util.concurrent.RejectedExecutionException

Message History
---------------------------------------------------------------------------------------------------------------------------------------
RouteId              ProcessorId          Processor                                                                        Elapsed (ms)
[route1            ] [route1            ] [file://src/data?noop=true                                                     ] [        63]
[route1            ] [setHeader1        ] [setHeader[myDest]                                                             ] [         4]
[route1            ] [toD1              ] [                                                                              ] [        42]

Stacktrace
---------------------------------------------------------------------------------------------------------------------------------------
java.util.concurrent.RejectedExecutionException
	at org.apache.camel.component.jms.JmsProducer.process(JmsProducer.java:141)
	at org.apache.camel.processor.SendDynamicProcessor$1.doInAsyncProducer(SendDynamicProcessor.java:124)
	at org.apache.camel.impl.ProducerCache.doInAsyncProducer(ProducerCache.java:436)
	at org.apache.camel.processor.SendDynamicProcessor.process(SendDynamicProcessor.java:119)
	at org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:542)
	at org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:197)
	at org.apache.camel.processor.Pipeline.process(Pipeline.java:120)
	at org.apache.camel.processor.Pipeline.process(Pipeline.java:83)
	at org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:197)
	at org.apache.camel.component.file.GenericFileConsumer.processExchange(GenericFileConsumer.java:460)
	at org.apache.camel.component.file.GenericFileConsumer.processBatch(GenericFileConsumer.java:227)
	at org.apache.camel.component.file.GenericFileConsumer.poll(GenericFileConsumer.java:191)
	at org.apache.camel.impl.ScheduledPollConsumer.doRun(ScheduledPollConsumer.java:175)
	at org.apache.camel.impl.ScheduledPollConsumer.run(ScheduledPollConsumer.java:102)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
	at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180)
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:745)

Add relativePath to all pom.xml

So they can find their parent and automatic build them.

Some users may have trouble because you need to build something first.

using log4j2 with Camel and Springboot

when using log4j2 logging with Camel and Spring boot via spring-boot-starter-log4j2, it is required that we need to add log4j2.xml instead of log4j2.properties as the spring boot log4j2 logger is unable to load log4j2.properties resulting in java.lang.NoSuchMethodError: org.apache.logging.log4j.core.config.ConfigurationFactory.getConfiguration ...

chapter6 - jpa test fails

This fails with Camel 2.18.0 and 2.18.1. Maybe its OpenJPA or something, if it was upgraded or whatever.

<openjpa-2.3.0-r422266:1540826 nonfatal user error> org.apache.openjpa.persistence.ArgumentException: This configuration disallows runtime optimization, but the following listed types were not enhanced at build time or at class load time with a javaagent: "
camelinaction.PurchaseOrder".
	at org.apache.openjpa.enhance.ManagedClassSubclasser.prepareUnenhancedClasses(ManagedClassSubclasser.java:115)
	at org.apache.openjpa.kernel.AbstractBrokerFactory.loadPersistentTypes(AbstractBrokerFactory.java:312)
	at org.apache.openjpa.kernel.AbstractBrokerFactory.initializeBroker(AbstractBrokerFactory.java:236)
	at org.apache.openjpa.kernel.AbstractBrokerFactory.newBroker(AbstractBrokerFactory.java:212)
	at org.apache.openjpa.kernel.DelegatingBrokerFactory.newBroker(DelegatingBrokerFactory.java:155)
	at org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:226)
	at org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:153)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:483)
	at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.invokeProxyMethod(AbstractEntityManagerFactoryBean.java:462)
	at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean$ManagedEntityManagerFactoryInvocationHandler.invoke(AbstractEntityManagerFactoryBean.java:633)
	at com.sun.proxy.$Proxy11.createEntityManager(Unknown Source)
	at org.apache.camel.component.jpa.JpaHelper.getTargetEntityManager(JpaHelper.java:63)
	at org.apache.camel.component.jpa.JpaProducer.process(JpaProducer.java:57)
	at org.apache.camel.util.AsyncProcessorConverterHelper$ProcessorToAsyncProcessorBridge.process(AsyncProcessorConverterHelper.java:61)
	at org.apache.camel.processor.SendProcessor.process(SendProcessor.java:145)
	at org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:542)
	at org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:197)
	at org.apache.camel.processor.Pipeline.process(Pipeline.java:120)
	at org.apache.camel.processor.Pipeline.process(Pipeline.java:83)
	at org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:197)
	at org.apache.camel.component.seda.SedaConsumer.sendToConsumers(SedaConsumer.java:298)
	at org.apache.camel.component.seda.SedaConsumer.doRun(SedaConsumer.java:207)
	at org.apache.camel.component.seda.SedaConsumer.run(SedaConsumer.java:154)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:745)

chapter12 / RiderAutoPartsPartnerTest fails

Here's the stack trace

-------------------------------------------------------------------------------
Test set: camelinaction.RiderAutoPartsPartnerTest
-------------------------------------------------------------------------------
Tests run: 2, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 15.436 sec <<< FAILURE!
testNoConnectionToDatabase(camelinaction.RiderAutoPartsPartnerTest)  Time elapsed: 6.776 sec  <<< FAILURE!
java.lang.AssertionError: expected:<0> but was:<1>
    at org.junit.Assert.fail(Assert.java:88)
    at org.junit.Assert.failNotEquals(Assert.java:743)
    at org.junit.Assert.assertEquals(Assert.java:118)
    at org.junit.Assert.assertEquals(Assert.java:555)
    at org.junit.Assert.assertEquals(Assert.java:542)
    at camelinaction.RiderAutoPartsPartnerTest.testNoConnectionToDatabase(RiderAutoPartsPartnerTest.java:73)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:497)
    at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
    at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
    at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
    at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
    at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
    at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
    at org.junit.rules.TestWatcher$1.evaluate(TestWatcher.java:55)
    at org.junit.rules.TestWatcher$1.evaluate(TestWatcher.java:55)
    at org.junit.rules.RunRules.evaluate(RunRules.java:20)
    at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)
    at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
    at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
    at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
    at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
    at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
    at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
    at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
    at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
    at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
    at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:59)
    at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:115)
    at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:102)
    at org.apache.maven.surefire.Surefire.run(Surefire.java:180)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:497)
    at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:350)
    at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:1021)

Chapter 12 - Update readme with heading numbering

There has been some changes which mean the readme.md files may point to wrong section numbering in their headings.

So when we get the chapter as final, then update the readme.md files in the source code.

Couldn't destroy threadgroup ... IllegalThreadStateException

Following the first maven example in Chapter1. The operation is successful with the file copy, but throws WARNING afterwards. Happened both with Maven 3.3.1 and 3.5.0 (I don't have 3.3.3 on MacOs)

MacOs, Java8u121, Mvn3.3.1, sha a806764

[camelinaction2/chapter1/file-copy (master)]$ mvn clean
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Camel in Action 2 :: Chapter 1 :: File Copy Example 2.0.0
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.4.1:clean (default-clean) @ chapter1-file-copy ---
[INFO] Deleting camelinaction2/chapter1/file-copy/target
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.331 s
[INFO] Finished at: 2017-05-05T12:59:42-07:00
[INFO] Final Memory: 9M/309M
[INFO] ------------------------------------------------------------------------
[camelinaction2/chapter1/file-copy (master)]$ mvn compile exec:java -Dexec.mainClass=camelinaction.FileCopierWithCamel
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Camel in Action 2 :: Chapter 1 :: File Copy Example 2.0.0
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-resources-plugin:2.4.3:resources (default-resources) @ chapter1-file-copy ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 1 resource
[INFO]
[INFO] --- maven-compiler-plugin:3.6.1:compile (default-compile) @ chapter1-file-copy ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 2 source files to camelinaction2/chapter1/file-copy/target/classes
[INFO]
[INFO] --- exec-maven-plugin:1.6.0:java (default-cli) @ chapter1-file-copy ---
[ion.FileCopierWithCamel.main()] DefaultCamelContext            INFO  Apache Camel 2.19.0 (CamelContext: camel-1) is starting
[ion.FileCopierWithCamel.main()] ManagedManagementStrategy      INFO  JMX is enabled
[ion.FileCopierWithCamel.main()] DefaultTypeConverter           INFO  Loaded 192 type converters
[ion.FileCopierWithCamel.main()] DefaultRuntimeEndpointRegistry INFO  Runtime endpoint registry is in extended mode gathering usage statistics of all incoming and outgoing endpoints (cache limit: 1000)
[ion.FileCopierWithCamel.main()] DefaultCamelContext            INFO  StreamCaching is not in use. If using streams then its recommended to enable stream caching. See more details at http://camel.apache.org/stream-caching.html
[ion.FileCopierWithCamel.main()] FileEndpoint                   INFO  Endpoint is configured with noop=true so forcing endpoint to be idempotent as well
[ion.FileCopierWithCamel.main()] FileEndpoint                   INFO  Using default memory based idempotent repository with cache max size: 1000
[ion.FileCopierWithCamel.main()] DefaultCamelContext            INFO  Route: route1 started and consuming from: file://data/inbox?noop=true
[ion.FileCopierWithCamel.main()] DefaultCamelContext            INFO  Total 1 routes, of which 1 are started.
[ion.FileCopierWithCamel.main()] DefaultCamelContext            INFO  Apache Camel 2.19.0 (CamelContext: camel-1) started in 0.229 seconds
[ion.FileCopierWithCamel.main()] DefaultCamelContext            INFO  Apache Camel 2.19.0 (CamelContext: camel-1) is shutting down
[ion.FileCopierWithCamel.main()] DefaultShutdownStrategy        INFO  Starting to graceful shutdown 1 routes (timeout 300 seconds)
[el-1) thread #1 - ShutdownTask] DefaultShutdownStrategy        INFO  Route: route1 shutdown complete, was consuming from: file://data/inbox?noop=true
[ion.FileCopierWithCamel.main()] DefaultShutdownStrategy        INFO  Graceful shutdown of 1 routes completed in 0 seconds
[ion.FileCopierWithCamel.main()] DefaultCamelContext            INFO  Apache Camel 2.19.0 (CamelContext: camel-1) uptime 10.252 seconds
[ion.FileCopierWithCamel.main()] DefaultCamelContext            INFO  Apache Camel 2.19.0 (CamelContext: camel-1) is shutdown in 0.018 seconds
[WARNING] thread Thread[ForkJoinPool.commonPool-worker-2,5,camelinaction.FileCopierWithCamel] was interrupted but is still alive after waiting at least 6999msecs
[WARNING] thread Thread[ForkJoinPool.commonPool-worker-2,5,camelinaction.FileCopierWithCamel] will linger despite being asked to die via interruption
[WARNING] thread Thread[ForkJoinPool.commonPool-worker-3,5,camelinaction.FileCopierWithCamel] will linger despite being asked to die via interruption
[WARNING] thread Thread[ForkJoinPool.commonPool-worker-4,5,camelinaction.FileCopierWithCamel] will linger despite being asked to die via interruption
[WARNING] NOTE: 3 thread(s) did not finish despite being asked to  via interruption. This is not a problem with exec:java, it is a problem with the running code. Although not serious, it should be remedied.
[WARNING] Couldn't destroy threadgroup org.codehaus.mojo.exec.ExecJavaMojo$IsolatedThreadGroup[name=camelinaction.FileCopierWithCamel,maxpri=10]
java.lang.IllegalThreadStateException
	at java.lang.ThreadGroup.destroy(ThreadGroup.java:778)
	at org.codehaus.mojo.exec.ExecJavaMojo.execute(ExecJavaMojo.java:321)
	at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
	at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
	at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
	at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
	at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
	at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307)
	at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)
	at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)
	at org.apache.maven.cli.MavenCli.execute(MavenCli.java:862)
	at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:286)
	at org.apache.maven.cli.MavenCli.main(MavenCli.java:197)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
	at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
	at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
	at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 26.884 s
[INFO] Finished at: 2017-05-05T13:00:12-07:00
[INFO] Final Memory: 29M/316M
[INFO] ------------------------------------------------------------------------
[camelinaction2/chapter1/file-copy (master)]$ git show
commit a806764a96c5ae50dfc7c1259fbc684394d0d0c4
Merge: 3e0f8da 6cdf7c7
Author: Claus Ibsen <[email protected]>
Date:   Fri May 5 11:34:52 2017 -0400

    Merge branch '219'
[camelinaction2/chapter1/file-copy (master)]$ java -version
java version "1.8.0_121"
Java(TM) SE Runtime Environment (build 1.8.0_121-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.121-b13, mixed mode)
[camelinaction2/chapter1/file-copy (master)]$ mvn -version
Apache Maven 3.3.1 (cab6659f9874fa96462afef40fcf6bc033d58c1c; 2015-03-13T13:10:27-07:00)
Maven home: /usr/local/Cellar/maven/3.3.1/libexec
Java version: 1.8.0_121, vendor: Oracle Corporation
Java home: /Library/Java/JavaVirtualMachines/jdk1.8.0_121.jdk/Contents/Home/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "mac os x", version: "10.11.6", arch: "x86_64", family: "mac"

Running Camel microservices in Docker (Section 18.1.2) 'Protocol family unavailable' error for wildfly-swarm

When running wildfly-swarm as described in section 18.1.4 on Windows 7 with boot docker running on Oracle VirtualBox the following error gets thrown:
ERROR [org.jboss.msc.service.fail] (MSC service thread 1-1) MSC000001: Failed to start service jboss.undertow.listener.default: org.jboss.msc.service.StartException in service jboss.undertow.listener.default: Could not start http listener
at org.wildfly.extension.undertow.ListenerService.start(ListenerService.java:142)
at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1948)
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1881)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.net.SocketException: Protocol family unavailable
at sun.nio.ch.Net.bind0(Native Method)
at sun.nio.ch.Net.bind(Net.java:433)
at sun.nio.ch.Net.bind(Net.java:425)
at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:223)
at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:74)
at org.xnio.nio.NioXnioWorker.createTcpConnectionServer(NioXnioWorker.java:190)
at org.xnio.XnioWorker.createStreamConnectionServer(XnioWorker.java:243)
at org.wildfly.extension.undertow.HttpListenerService.startListening(HttpListenerService.java:126)
at org.wildfly.extension.undertow.ListenerService.start(ListenerService.java:138)
... 5 more
The solution to this problem is to add the following section to the pom.xml:
<plugins>
<plugin>
<groupId>org.wildfly.swarm</groupId>
<artifactId>wildfly-swarm-plugin</artifactId>
<version>${wildfly-swarm-version}</version>
<!-- Add configuration element before executions element -->
<configuration>
<properties>
<java.net.preferIPv4Stack>true</java.net.preferIPv4Stack>
</properties>
</configuration>
<executions>
...
Stackoverflow link: https://stackoverflow.com/questions/37273621/fail-to-start-jax-rs-service-on-wildfly-swarm

Remove license header in source files

Some source has ASF license header that says it belongs to ASF foundation. We dont have license headers, but just a LICENSE text file in the root

Unable to Build client-spring on windows

Hi,

I followed instruction as per mentioned in Chapter 18 but facing following error on windows

[INFO] --- docker-maven-plugin:0.21.0:build (default-cli) @ spring-docker ---
[ERROR] DOCKER> Cannot create docker access object [Cannot extract API version from server https://192.168.99.100:2376 : sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 4.294 s
[INFO] Finished at: 2017-06-03T16:41:21+04:00
[INFO] Final Memory: 35M/354M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal io.fabric8:docker-maven-plugin:0.21.0:build (default-cli) on project spring-docker: Cannot create docker access object: Cannot extract API version from server https://192.168.99.100:2376 : sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal io.fabric8:docker-maven-plugin:0.21.0:build (default-cli) on project spring-docker: Cannot create docker access object
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:213)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:154)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:146)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:117)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:81)

chapter10/camel-cxf-rest-spring-boot on minishift

Hi,
I tried to run chapter10-camel-cxf-rest-spring-boot example on minishift, it was successfully deployed using fabric8 plugin with NodePort type.

<configuration>
					<enricher>
						<config>
							<fmp-service>
								<type>NodePort</type>
							</fmp-service>
						</config>
					</enricher>
				</configuration>

I change route like

from("cxfrs:http://0.0.0.0:9191?resourceClasses=camelinaction.RestOrderService&bindingStyle=SimpleConsumer&providers=#jsonProvider")

But I am unable to access API out of cluster. though its working fine when i CURL it from minishift console terminal option.

How we can access it out of cluster and map NODEPORT like 30055 --> 9191?

C:\mycluster>oc get routes

Above command gives following URL, but its not accessible from it too.

******-minishift.192.168.99.101.nip.io

Regards,

Error starting Jetty

When i do a mvn spring-boot:run I get the exception below. It appears Jetty wants port 8080 but Tomcat already has it. Full Stacktrace attached.
stacktrace.txt

org.apache.camel.spring.boot.CamelSpringBootInitializationException: org.apache.cxf.interceptor.Fault: Could not start Jetty server on port 8,080: Address already in use: bind

Edit: Excluding Tomcat and adding a Jetty dependency results in the same error except Jetty already has the port.

[Chapter 1] MVN Issue

Hi I'm reading the book in MEAP version and going step by step and verifying the examples.
So I have tried the chapter 1 mvn compile exec:java -Dexec.mainClass=camelinaction.FileCopierWithCamel.
The results is:
D:\Sandbox\camelinaction2\chapter1\file-copy
PS>mvn compile exec:java -Dexec.mainClass=camelinaction.FileCopierWithCamel
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Camel in Action 2 :: Chapter 1 :: File Copy Example 2.0.0
[INFO] ------------------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.547 s
[INFO] Finished at: 2017-03-30T10:29:22+02:00
[INFO] Final Memory: 12M/491M
[INFO] ------------------------------------------------------------------------
[ERROR] Unknown lifecycle phase ".mainClass=camelinaction.FileCopierWithCamel". You must specify a valid lifecycle phase or a goal in the format : or :[:]:. Available lifecycle phases are: validate, initialize, generate-sources, process-sources, generate-resources, process-resources, compile, process-classes, generate-test-sources, process-test-sources, generate-test-resources, process-test-resources, test-compile, process-test-classes, test, prepare-package, package, pre-integration-test, integration-test, post-integration-test, verify, install, deploy, pre-clean, clean, post-clean, pre-site, site, post-site, site-deploy. -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/LifecyclePhaseNotFoundException

Chapter18 kubernetes/client-spring/pom.xml has extraneous <version>/<version> entry

I cd'd to chapter18/kubernetes/client-spring, and got the following after executing mvn clean install fabric8:run

[kearls@planet-express client-spring]$ mvn clean install fabric8:run
[INFO] Scanning for projects...
[ERROR] [ERROR] Some problems were encountered while processing the POMs:
[ERROR] 'dependencies.dependency.version' for org.springframework.boot:spring-boot-actuator:jar is missing. @ line 60, column 16
@
[ERROR] The build could not read 1 project -> [Help 1]
[ERROR]
[ERROR] The project com.camelinaction:spring-kubernetes:2.0-SNAPSHOT (/home/kearls/sources/books/forks/camelinaction2/chapter18/kubernetes/client-spring/pom.xml) has 1 error
[ERROR] 'dependencies.dependency.version' for org.springframework.boot:spring-boot-actuator:jar is missing. @ line 60, column 16
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/ProjectBuildingException

Upgrade WildFly-Swarm

The camel-other is now fine grained so it may need some changes in the book as well.

Chapter 10 build fails because of duplicate artifactId

mvn clean install in chapter10 produces

[ERROR] [ERROR] Project 'com.camelinaction:chapter10-spark-rest-json:2.0.0' is duplicated in the reactor @
[ERROR] Project 'com.camelinaction:chapter10-spark-rest-json:2.0.0' is duplicated in the reactor -> [Help 1]

This is because both the poms for spark-rest-json and springboot-json contain "chapter10-spark-rest-json"

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.