Skip to content

Commit 478d6b1

Browse files
committed
GH-9862: Document caching for SMB sessions
Fixes: #9862 * Fix typo in the `message.adoc`
1 parent 4bf83f3 commit 478d6b1

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed

src/reference/antora/modules/ROOT/pages/message.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -433,4 +433,4 @@ class PiiMessage<P> extends GenericMessage<P> {
433433
}
434434
----
435435

436-
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.
436+
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.

src/reference/antora/modules/ROOT/pages/smb.adoc

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,23 @@ public SmbSessionFactory smbSessionFactory() {
9595
}
9696
----
9797

98+
[[smb-session-caching]]
99+
== SMB Session Caching
100+
101+
The `SmbSessionFactory` initiates a new connection every time when a `Session` is requested.
102+
In most cases that is not necessary and `Session` could be cached.
103+
For that purpose, the `SmbSessionFactory` as mentioned earlier should be wrapped into an instance of `CachingSessionFactory`:
104+
[source,java]
105+
----
106+
@Bean
107+
public CachingSessionFactory cachingSessionFactory(SmbSessionFactory smbSessionFactory) {
108+
cachingSessionFactory cachingSessionFactory = new CachingSessionFactory(smbSessionFactory, 10);
109+
cachingSessionFactory.setSessionWaitTimeout(1000);
110+
return cachingSessionFactory;
111+
}
112+
----
113+
And then its bean can be injected into channel adapters described below.
114+
98115
[[smb-inbound]]
99116
== SMB Inbound Channel Adapter
100117

0 commit comments

Comments
 (0)