Wiki source code of SMB Connectivity

Version 10.1 by Bouke Reitsma on 2024/05/06 10:59

Show last authors
1 {{container}}{{container layoutStyle="columns"}}(((
2 In some cases, there is no communication possible with a local file directory. Or there is a requirement from the external party to place the files somewhere else. Mainly the somewhere else is either an FTP or an SFTP. However, there is a third communication protocol that can be used for file transfer. In this microlearning we will take a look at Server Message Block (SMB) connectivity within eMagiz.
3
4 Should you have any questions, please get in touch with [[academy@emagiz.com>>mailto:academy@emagiz.com]].
5
6 == 1. Prerequisites ==
7
8 * Basic knowledge of the eMagiz platform
9 * Novice course on File-based connectivity
10
11 == 2. Key concepts ==
12
13 This microlearning is about SMB (connectivity).
14
15 By SMB connectivity, we mean: Making sure that eMagiz can communicate with the SMB protocol to exchange file-based data.
16
17 * SMB (Server Message Block) is a network protocol for transmitting files between computers over Transmission Control Protocol/Internet Protocol (TCP/IP) connections.
18 * In an SMB transaction, the end user's computer is typically called the localhost. The second computer involved in SMB is a remote host, which is usually a server.
19 * Servers must be set up to run SMB services, and the client must have SMB software installed to access these services.
20 * eMagiz provides several components to set up the SMB connection
21
22 == 3. SMB Connectivity ==
23
24 In some cases, there is no communication possible with a local file directory. Or there is a requirement from the external party to place the files somewhere else. Mainly the somewhere else is either an FTP or an SFTP. However, there is a third communication protocol that can be used for file transfer. In this microlearning we will take a look at Server Message Block (SMB) connectivity within eMagiz.
25
26 * SMB (Server Message Block) is a network protocol for transmitting files between computers over Transmission Control Protocol/Internet Protocol (TCP/IP) connections.
27 * In an SMB transaction, the end user's computer is typically called the localhost. The second computer involved in SMB is a remote host, which is usually a server.
28 * Servers must be set up to run SMB services, and the client must have SMB software installed to access these services.
29 * eMagiz provides several components to set up the SMB connection
30
31 So, where the file pickup component searches on the local host for the correct directory, the idea of the SMB setup is that the directory with whom to communicate exists on a remote host. The local host and the remote host can talk to each other via the SMB protocol. That is, in a nutshell, the difference between setting up an SMB connection and communicating with local directories.
32
33 eMagiz provides only one support objects to connect to an SMB:
34
35 * SMB session factory
36
37 [[image:Main.Images.Microlearning.WebHome@intermediate-file-based-connectivity-ftp-connectivity--ftp-support-objects.png]]
38
39 === 3.1 Configuration in eMagiz ===
40
41 To configure the connection between eMagiz and the SMB, we need two (or three) components. This depends on whether we want to read, write or do both while communicating with the SMB. If we're going to do both, we need both of the functional components. In all other scenarios, you only need one of the functional components. The functional components that you might need are called:
42
43 * SMB inbound Channel adapter
44 * SMB outbound Channel adapter
45
46 On top of that, you need the following support objects.
47
48 * SMB session factory
49
50 In this microlearning, we will use the SMB inbound channel adapter combined with the SMB session factory to illustrate the configuration. Please note that any other combination works similarly. To configure the connection with the SMB, we first navigate to the Create phase of eMagiz. Here we open the flow we want to edit. In this example, that will be an entry flow as we want to retrieve (read) data from the SMB.
51
52 When you have opened the flow, you need to enter "Start Editing" mode. After you have done so, we first add the SMB session factory support object to our flow.
53
54 [[image:Main.Images.Microlearning.WebHome@intermediate-file-based-connectivity-ftp-connectivity--default-ftp-session-factory-empty.png]]
55
56 Here, we need to define the following:
57
58 * Host
59 * Port
60 * Username
61 * Password
62
63 As best practise, we also define the share and directory value. The value for this field is the main folder for your fileshare. In case the main folder is the exchange folder, this field should be empty and the main folder should be configured as remote directory in the SMB inbound Channel adapter.
64
65 [[image:Main.Images.Microlearning.WebHome@intermediate-file-based-connectivity-ftp-connectivity--default-ftp-session-factory-filled-in.png]]
66
67 The settings on the Advanced tab don't have to be changed in most cases. If your specific setup does require a change to these settings, please consult the help texts on the component level for advice.
68
69 Now that we have configured the support object adding the SMB inbound channel adapter to the flow has become time.
70
71 [[image:Main.Images.Microlearning.WebHome@intermediate-file-based-connectivity-ftp-connectivity--ftp-inbound-channel-adapter-empty.png]]
72
73 In this component, we need to define the remote directory where the original files are located. We need to specify the local directory used to store the files before they are processed temporarily. Furthermore, we need to link the support object we have just created and define a poller. For that last one, the best practice is the use of a cron trigger.
74
75 [[image:Main.Images.Microlearning.WebHome@intermediate-file-based-connectivity-ftp-connectivity--ftp-inbound-channel-adapter-filled-in.png]]
76
77 Apart from these configurations, you could also add a filter, just as we learned in the Crash Course Messaging on file-based connectivity. Finishing things off, we should consider the delete behavior we will use. Based on the filter and the business requirements, whether to delete and when to delete could differ. So please consider all your options in that regard.
78
79 === 3.2 SMB Gateway ===
80
81
82
83 This concludes our microlearning, in which we learned how to set up the connectivity with an SMB.
84
85 == 4. Key takeaways ==
86
87 * FTP (File Transfer Protocol) is a network protocol for transmitting files between computers over Transmission Control Protocol/Internet Protocol (TCP/IP) connections.
88 * In an FTP transaction, the end user's computer is typically called the localhost. The second computer involved in FTP is a remote host, which is usually a server.
89 * Servers must be set up to run FTP services, and the client must have FTP software installed to access these services.
90 * eMagiz provides several components to set up the FTP connection
91
92 == 5. Suggested Additional Readings ==
93
94 If you are interested in this topic and want more information, please read the release notes provided by eMagiz. Furthermore, check out these links:
95
96 * [[FTP Inbound>>https://docs.spring.io/spring-integration/docs/2.1.x/reference/html/ftp.html#ftp-inbound||target="blank"]]
97 * [[FTP Session Factory>>https://docs.spring.io/spring-integration/docs/4.3.x/reference/html/ftp.html#ftp-session-factory||target="blank"]]
98 * [[FTP Explained>>https://searchnetworking.techtarget.com/definition/File-Transfer-Protocol-FTP||target="blank"]]
99
100 )))((({{toc/}}))){{/container}}{{/container}}