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
As discussed in GH-9211, creating a new issue for this item:
I have applied the fix introduced in 6.2.6 from the issue above and the problem using the SMB outbound gateway has indeed been resolved, but I now run into the issue that the behavior of the inbound channel adapter is also changed.
Previously, the setup described in the sample config below worked perfectly, giving me the files in my somedir/anotherdir directory. With the applied changes this 'list' operation is considered to be a get single file operation, and will fail with IOException: [somedir/anotherdir] is not a file. As a workaround, it seems that it is possible to provide 'remote-directory' as somedir\anotherdir, as that bypasses line 137 that checks for the occurence of the /, and the SMB calls seem to become normalized (as I am now effectively calling the path (...)/test/somedir\anotherdir/).
Is this intended behavior, where the remote directory may not contain multiple directories, and 'share and dir' of the SessionFactory must point to the parent of the desired directory? That seems to be in contrast with e.g. SFTP or file inbound gateways, where the 'remote directory' field can contain multiple directories.
Sample config:
<smb:inbound-channel-adapter
session-factory="smbSessionFactory"
local-directory="/tmp/smb"
auto-create-local-directory="true"
channel="smbInbound"
remote-directory="somedir/anotherdir"> <!-- Used to work pre-6.2.6, now needs to be 'somedir\anotherdir' to achieve the same -->
<si:poller fixed-rate="10" time-unit="SECONDS"/>
</smb:inbound-channel-adapter>
<si:channel id="smbInbound"/>
(...)
<bean id="smbSessionFactory" class="org.springframework.integration.smb.session.SmbSessionFactory">
<property name="host" value="localhost"/>
<property name="domain" value=""/>
<property name="username" value="username"/>
<property name="password" value="password"/>
<property name="shareAndDir" value="test"/>
</bean>
The text was updated successfully, but these errors were encountered:
smitsjelle
changed the title
SMB inbound channel adapter behavoir changed with 6.2.6
SMB inbound channel adapter behavior changed with 6.2.6
Jun 24, 2024
Fixes: #9268
The new `SmbSession.list()` behavior prevents to pull files from sub-folders in inbound channel adapter
* Fix `SmbSession.list()` similar way to `SftpSession`: if `remoteFile.isFile()` then remove it as is.
Otherwise, perform `smbDir.listFiles()` on that sub-dir
* Modify `SmbTests.testSmbInboundFlow()` to poll files from the `smbSource/subSmbSource/`
(cherry picked from commit f2399a4)
Fixes: #9268
The new `SmbSession.list()` behavior prevents to pull files from sub-folders in inbound channel adapter
* Fix `SmbSession.list()` similar way to `SftpSession`: if `remoteFile.isFile()` then remove it as is.
Otherwise, perform `smbDir.listFiles()` on that sub-dir
* Modify `SmbTests.testSmbInboundFlow()` to poll files from the `smbSource/subSmbSource/`
(cherry picked from commit f2399a4)
Fixes: spring-projects#9268
The new `SmbSession.list()` behavior prevents to pull files from sub-folders in inbound channel adapter
* Fix `SmbSession.list()` similar way to `SftpSession`: if `remoteFile.isFile()` then remove it as is.
Otherwise, perform `smbDir.listFiles()` on that sub-dir
* Modify `SmbTests.testSmbInboundFlow()` to poll files from the `smbSource/subSmbSource/`
**Auto-cherry-pick to `6.3.x` & `6.2.x`**
Spring integration version used: 6.2.6
As discussed in GH-9211, creating a new issue for this item:
I have applied the fix introduced in 6.2.6 from the issue above and the problem using the SMB outbound gateway has indeed been resolved, but I now run into the issue that the behavior of the inbound channel adapter is also changed.
Previously, the setup described in the sample config below worked perfectly, giving me the files in my somedir/anotherdir directory. With the applied changes this 'list' operation is considered to be a get single file operation, and will fail with
IOException: [somedir/anotherdir] is not a file
. As a workaround, it seems that it is possible to provide 'remote-directory' assomedir\anotherdir
, as that bypasses line 137 that checks for the occurence of the/
, and the SMB calls seem to become normalized (as I am now effectively calling the path(...)/test/somedir\anotherdir/
).Is this intended behavior, where the remote directory may not contain multiple directories, and 'share and dir' of the SessionFactory must point to the parent of the desired directory? That seems to be in contrast with e.g. SFTP or file inbound gateways, where the 'remote directory' field can contain multiple directories.
Sample config:
The text was updated successfully, but these errors were encountered: