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:
Artem Bilan
2025-02-24 12:20:19 -05:00
parent 4bf83f3d87
commit 478d6b1b07
2 changed files with 18 additions and 1 deletions

View File

@@ -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.

View File

@@ -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