You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Which allows you to configure a component using any name, but it's common to use the same name
83
105
eg (`activemq`). Then you can refer to the component using `activemq:destinationName`.
84
106
85
107
This works by the Camel lazily fetching components from the Spring context for the scheme name you use for Endpoint xref:uris.adoc[URI]s.
@@ -89,42 +111,40 @@ This works by the Camel lazily fetching components from the Spring context for t
89
111
You can use Java Code to define your xref:route-builder.adoc[RouteBuilder] implementations. These can be defined as beans in spring and then referenced in your camel context e.g.
Camel also provides a powerful feature that allows for the automatic discovery and initialization of routes in given packages. This is configured by adding tags to the camel context in your spring context definition, specifying the packages to be recursively searched for RouteBuilder implementations. To use this feature in 1.X, requires a <package></package> tag specifying a comma separated list of packages that should be searched e.g.
Which will skip classes that has _Special_ in the name.
130
150
@@ -137,20 +157,20 @@ Exclude patterns are applied before the include patterns. If no include or exclu
137
157
You can allow Camel to scan the container context, e.g. the Spring ApplicationContext for route builder instances. This allow you to use the Spring *<component-scan>* feature and have Camel pickup any *`RouteBuilder`* instances which was created by Spring in its scan process.
Copy file name to clipboardExpand all lines: docs/user-manual/modules/ROOT/pages/spring.adoc
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -23,7 +23,7 @@ To use Camel with Spring XML files see the xref:spring-xml-extensions.adoc[Sprin
23
23
24
24
== Using Spring dependency injection
25
25
26
-
Spring dependency injection is integrated first-class when using Spring and Spring together.
26
+
Spring dependency injection is integrated first-class when using Camel and Spring together.
27
27
28
28
For example when using Camel on Spring Boot, then you can use any kind of Spring dependency and
29
29
be able to inject Camel resources such as 'CamelContext', xref:endpoint.adoc[Endpoint] and many more.
@@ -38,5 +38,5 @@ See xref:components:eips:transactional-client.adoc[Transactional Client] EIP.
38
38
39
39
== Using Camel with Spring testing
40
40
41
-
See xref:components:others:test-spring-junit5.adoc[camel-test-spring-junit5] documentation.
41
+
See xref:components:others:test-spring-junit5.adoc[camel-test-spring-junit5] and xref:components:others:test-spring-junit6.adoc[camel-test-spring-junit6] documentation.
| allowClasses | | To filter stream caching of a given set of allowed/denied classes. By default, all classes that are `java.io.InputStream` is allowed. Multiple class names can be separated by comma.
42
-
38
+
| anySpoolRules | false | Whether any or all ``SpoolRule``s must return `true` to determine if the stream should be spooled or not. This can be used as applying AND/OR binary logic to all the rules. By default it's AND based.
39
+
| bufferSize | 4096 | Sets the buffer size to use when allocating in-memory buffers used for in-memory stream caches.
43
40
| denyClasses | | To filter stream caching of a given set of allowed/denied classes. By default, all classes that are `java.io.InputStream` is allowed. Multiple class names can be separated by comma.
| Base directory where temporary files for spooled streams should be stored. This option supports naming patterns as documented below.
50
-
51
-
| spoolCipher | null
52
-
| If set, the temporary files are encrypted using the specified cipher transformation (i.e., a valid stream or 8-bit cipher name such as "RC4", "AES/CTR/NoPadding". An empty name "" is treated as null).
53
-
54
-
| spoolThreshold | 128 KB
55
-
| Size in bytes when the stream should be spooled to disk instead of keeping in memory. Use a value of 0 or negative to disable it all together so streams is always kept in memory regardless of their size.
56
-
57
-
| spoolUsedHeapMemoryThreshold | 0
58
-
| A percentage (1 to 99) of current used heap memory to use as threshold for spooling streams to disk. The upper bounds is based on heap committed (guaranteed memory the JVM can claim). This can be used to spool to disk when running low on memory.
59
-
60
-
| spoolUsedHeapMemoryLimit | Max
61
-
| If `spoolUsedHeapMemoryThreshold` is in use, then whether the used heap memory upper limit is either Max or Committed.
62
-
63
-
| anySpoolRules | false
64
-
| Whether any or all ``SpoolRule``s must return `true` to determine if the stream should be spooled or not. This can be used as applying AND/OR binary logic to all the rules. By default it's AND based.
65
-
66
-
| bufferSize | 4096
67
-
| Sets the buffer size to use when allocating in-memory buffers used for in-memory stream caches.
68
-
69
-
| removeSpoolDirectoryWhenStopping | true
70
-
| Whether to remove the spool directory when stopping xref:camelcontext.adoc[CamelContext].
71
-
72
-
| statisticsEnabled | false
73
-
| Whether utilization statistics is enabled. By enabling this you can see these statics for example with JMX.
| enabled | true | Whether stream caching is enabled
42
+
| removeSpoolDirectoryWhenStopping | true | Whether to remove the spool directory when stopping xref:camelcontext.adoc[CamelContext].
43
+
| spoolCipher | null | If set, the temporary files are encrypted using the specified cipher transformation (i.e., a valid stream or 8-bit cipher name such as "RC4", "AES/CTR/NoPadding". An empty name "" is treated as null).
44
+
| spoolDirectory | ${java.io.tmpdir}/camel/camel-tmp-\#uuid# | Base directory where temporary files for spooled streams should be stored. This option supports naming patterns as documented below.
45
+
| spoolEnabled | false | Whether spool to disk is enabled
46
+
| spoolThreshold | 128 KB | Size in bytes when the stream should be spooled to disk instead of keeping in memory. Use a value of 0 or negative to disable it all together so streams is always kept in memory regardless of their size.
47
+
| spoolUsedHeapMemoryLimit | Max | If `spoolUsedHeapMemoryThreshold` is in use, then whether the used heap memory upper limit is either Max or Committed.
48
+
| spoolUsedHeapMemoryThreshold | 0 | A percentage (1 to 99) of current used heap memory to use as threshold for spooling streams to disk. The upper bounds is based on heap committed (guaranteed memory the JVM can claim). This can be used to spool to disk when running low on memory.
49
+
| statisticsEnabled | false | Whether utilization statistics is enabled. By enabling this you can see these statics for example with JMX.
50
+
|===
75
51
76
52
=== SpoolDirectory naming pattern
77
53
@@ -133,9 +109,25 @@ from("file:inbox")
133
109
.to("bean:foo");
134
110
----
135
111
136
-
== Configuring StreamCachingStrategy in XML
112
+
== Configuring Stream Caching using Application Properties
113
+
114
+
When using Spring Boot, Quarkus or Camel Standalone It's recommended to configure stream caching in the `application.properties` configuration file:
TIP: You can run Camel JBang: `camel doc main --filter=stream` from CLI to see all the options.
126
+
127
+
128
+
== Configuring StreamCachingStrategy in Spring XML
137
129
138
-
In XML you can enable stream caching on the `<camelContext>` and then do the configuration in the `streamCaching` element:
130
+
In xref:spring-xml-extensions.adoc[Spring XML] you can enable stream caching on the `<camelContext>` and then do the configuration in the `streamCaching` element:
0 commit comments