GH-9862: Document caching for SMB sessions
Fixes: https://github.com/spring-projects/spring-integration/issues/9862 * Fix typo in the `message.adoc`
This commit is contained in:
@@ -433,4 +433,4 @@ class PiiMessage<P> extends GenericMessage<P> {
|
||||
}
|
||||
----
|
||||
|
||||
The this `PiiMessageBuilderFactory` could be registered as a bean, and whenever the framework logs the message (e.g. in case of `errorChannel`), the `password` header will be masked.
|
||||
Then this `PiiMessageBuilderFactory` could be registered as a bean, and whenever the framework logs the message (e.g. in case of `errorChannel`), the `password` header will be masked.
|
||||
@@ -95,6 +95,23 @@ public SmbSessionFactory smbSessionFactory() {
|
||||
}
|
||||
----
|
||||
|
||||
[[smb-session-caching]]
|
||||
== SMB Session Caching
|
||||
|
||||
The `SmbSessionFactory` initiates a new connection every time when a `Session` is requested.
|
||||
In most cases that is not necessary and `Session` could be cached.
|
||||
For that purpose, the `SmbSessionFactory` as mentioned earlier should be wrapped into an instance of `CachingSessionFactory`:
|
||||
[source,java]
|
||||
----
|
||||
@Bean
|
||||
public CachingSessionFactory cachingSessionFactory(SmbSessionFactory smbSessionFactory) {
|
||||
cachingSessionFactory cachingSessionFactory = new CachingSessionFactory(smbSessionFactory, 10);
|
||||
cachingSessionFactory.setSessionWaitTimeout(1000);
|
||||
return cachingSessionFactory;
|
||||
}
|
||||
----
|
||||
And then its bean can be injected into channel adapters described below.
|
||||
|
||||
[[smb-inbound]]
|
||||
== SMB Inbound Channel Adapter
|
||||
|
||||
|
||||
Reference in New Issue
Block a user