Changes for page SMB Connectivity
Last modified by Danniar Firdausy on 2024/09/18 20:40
From version 5.1
edited by Bouke Reitsma
on 2024/05/02 11:13
on 2024/05/02 11:13
Change comment:
There is no comment for this version
To version 12.2
edited by Bouke Reitsma
on 2024/05/06 11:28
on 2024/05/06 11:28
Change comment:
There is no comment for this version
Summary
-
Page properties (1 modified, 0 added, 0 removed)
Details
- Page properties
-
- Content
-
... ... @@ -16,7 +16,7 @@ 16 16 17 17 * SMB (Server Message Block) is a network protocol for transmitting files between computers over Transmission Control Protocol/Internet Protocol (TCP/IP) connections. 18 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 FTPsoftware installed to access these services.19 +* Servers must be set up to run SMB services, and the client must have SMB software installed to access these services. 20 20 * eMagiz provides several components to set up the SMB connection 21 21 22 22 == 3. SMB Connectivity == ... ... @@ -25,101 +25,65 @@ 25 25 26 26 * SMB (Server Message Block) is a network protocol for transmitting files between computers over Transmission Control Protocol/Internet Protocol (TCP/IP) connections. 27 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 FTPsoftware installed to access these services.28 +* Servers must be set up to run SMB services, and the client must have SMB software installed to access these services. 29 29 * eMagiz provides several components to set up the SMB connection 30 30 31 ------------------------------------------------------------------------------------------------------------------------------------ 32 - 33 -So, where the file pickup component searches on the local host for the correct directory, the idea of the FTP 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 FTP protocol. That is, in a nutshell, the difference between setting up an FTP connection and communicating with local directories. 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. 34 34 35 -eMagiz provides two support objects to connect to anFTP:33 +eMagiz provides only one support objects to connect to an SMB: 36 36 37 -* Default FTP caching session factory 38 -* Default FTP session factory 35 +* SMB session factory 39 39 40 -[[image:Main.Images.Microlearning.WebHome@intermediate-file-based-connectivity- ftp-connectivity--ftp-support-objects.png]]37 +[[image:Main.Images.Microlearning.WebHome@intermediate-file-based-connectivity-smb-connectivity-smb-support-object.png]] 41 41 42 - Themain difference between the two is the caching part.The caching sessionactory comes with the option to re-use the existingsession for multiplerequests. In other words, this way, you do nothave to authenticate yourself every time you wantto communicate with the FTP. This behavior is beneficialif a high frequency of communication is needed between eMagizand the FTP to handle the incoming and outgoing data packages.39 +=== 3.1 Configuration in eMagiz === 43 43 44 - If youonlyinitiate communication infrequently,for example,once perday,thedefaultsessionfactorybecomesmoreinterestingasthisclosesthesessionaftereachtransmission.Thisbehaviorisbeneficialin casesoflow-frequencycommunicationbecauseotherwise,thesessionwouldremain activeforanextensiveperiod.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: 45 45 46 -[[image:Main.Images.Microlearning.WebHome@intermediate-file-based-connectivity-ftp-connectivity--ftp-caching-help-text.png]] 43 +* SMB inbound Channel adapter 44 +* SMB outbound Channel adapter 47 47 48 - ===3.1 Bestracticesfor usingFTP===46 +On top of that, you need the following support objects. 49 49 50 - ====3.1.1Whichsession factorydo I need? ====48 +* SMB session factory 51 51 52 - Whenoccasionally retrievingorwriting files toFTP,use the_DefaultFTPsession factory_.Anewconnectionwill betup whenyou use the _DefaultFTPsessionfactory_foreverymessage/file.OnsomeFTPservers,thismight takeuptosecondsforeachlogin.Thisfactmight impacttheperformanceofyour flow.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. 53 53 54 -When you needbetterperformance(saywritingmultiplefiles ina minuteorretrievingfileseveryminute),use the_DefaultFTP **caching**sessionfactory_. The_DefaultFTP **caching**session factory_sharesFTP sessionsformessages in your flow.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. 55 55 56 - ==== 3.1.2 DoIhavetoset upaymechanism? ====54 +[[image:Main.Images.Microlearning.WebHome@intermediate-file-based-connectivity-smb-connectivity-smb-session-factory-empty.png]] 57 57 58 - When writing files to FTP,it is advisableto set a retry mechanism. Find theadvanced tabonyour _FTP outboundchannel adapter_. Under_Requestandleradvice chain_ add a _Retry Advice_.56 +Here, we need to define the following: 59 59 60 -==== 3.1.3 I get a _Failed to list files/items_ or a _Failed to obtain pooled item_. What can I do? ==== 58 +* Host 59 +* Port 60 +* Username 61 +* Password 61 61 62 - Incorrect connectionsettingscan causethis.Checkwhetherthecorrectpropertiesvebeen set andwhether theruntime has retrieved thelatestproperties.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. 63 63 64 - ==== 3.1.4 Igeta_Failed to list files /items_, a _Pipeclosed_or an_inputstreamlosed_.What canI do? ====65 +[[image:Main.Images.Microlearning.WebHome@intermediate-file-based-connectivity-smb-connectivity-smb-session-factory-filled-in.png]] 65 65 66 - A closedFTPsession cancause thesenotificationsduetoinactivity.For the_DefaultFTP**caching**sessionfactory_,always set the_Server aliveinterval_propertyto30000 (ms).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. 67 67 68 - ====3.1.6I geta_Failed towriteto_.What canIdo?====69 +Now that we have configured the support object adding the SMB inbound channel adapter to the flow has become time. 69 69 70 - Maybethe target folderdoesnotexist, andthe_Auto-createdirectory_ is off. Itis also possiblethat theon settingsare incorrect. Check whether the correct properties havebeenset andwhether the runtimehas retrievedthe latest properties.71 +[[image:Main.Images.Microlearning.WebHome@intermediate-file-based-connectivity-smb-connectivity-smb-inbound-channel-adapter-empty.png]] 71 71 72 - ====3.1.7Ioftenget'Disconnecting fromsftp.example.comport22'andthena'Caughtan exception,leavingmain loopdue toSocketclosed'warnings.====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. 73 73 74 - Toomany connections can causethistothesameserveratthesame time. If you havemanyflowsngto thesame FTP server, ensure that the crons donottriggersimultaneously.75 +[[image:Main.Images.Microlearning.WebHome@intermediate-file-based-connectivity-smb-connectivity-smb-inbound-channel-adapter-filled-in.png]] 75 75 76 - ====3.1.8Iget a'Failed to create SFTPClient'====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. 77 77 78 - SFTP,FTP,and FTPS arethree different remote file transfer protocolswith their _session factory_components in the eMagiz flow designer. Make sure you use the one that corresponds to the server's protocol.79 +=== 3.2 SMB Gateway === 79 79 80 - ====3.1.9One ofmyremotefilesisnot pickedupfrom theSFTPserver(withoutanywarning)====81 +The SMB Gateway is an additional component that can be used to interact with your SMB share. It enables the use of a set of pre-configured commands to for example delete files. The reply messages depend on the selected command. Every command option is explained within the helptext. An example configuration to send files is shown below. 81 81 82 -The default local filter is _AcceptOnceFileListFilter_. This can be replaced by your file list filter on the _FTP inbound channel adapter's_. 83 -If every day you retrieve a file with the same filename and the _Delete remote files_ property is set, it is advised to use a different local filename. You can add the current timestamp, for example. 83 +[[image:Main.Images.Microlearning.WebHome@intermediate-file-based-connectivity-smb-connectivity-smb-outbound-gateway-filled-in.png]] 84 84 85 - ==== 3.1.10 Whichmode isneeded====85 +This concludes our microlearning, in which we learned how to set up the connectivity with an SMB. 86 86 87 -When running in the current-generation architecture (G3) the FTP always needs to run **passive** mode. 88 - 89 -=== 3.2 Configuration in eMagiz === 90 - 91 -To configure the connection between eMagiz and the FTP, we need two (or three) components. This depends on whether we want to read, write or do both while communicating with the FTP. 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: 92 - 93 -* FTP Inbound Channel adapter 94 -* FTP Outbound Channel adapter 95 - 96 -On top of that, you need one of the following support objects. If you are unsure of which to use, please check out the information above in this microlearning. 97 - 98 -* Default FTP caching session factory 99 -* Default FTP session factory 100 - 101 -In this microlearning, we will use the FTP Inbound channel adapter combined with the Default FTP session factory to illustrate the configuration. Please note that any other combination works similarly. To configure the connection with the FTP, 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 FTP. 102 - 103 -When you have opened the flow, you need to enter "Start Editing" mode. After you have done so, we first add the support object to our flow. In this case, we will use the Default FTP session factory. 104 - 105 -[[image:Main.Images.Microlearning.WebHome@intermediate-file-based-connectivity-ftp-connectivity--default-ftp-session-factory-empty.png]] 106 - 107 -Here, we need to define at least the host and the port. Note that the username and password are optional for an FTP, which makes it less secure. Although in practice, we generally see that the FTP is secured with the help of a username-password combination. As a best practice, we use property references to fill in the various elements. 108 - 109 -[[image:Main.Images.Microlearning.WebHome@intermediate-file-based-connectivity-ftp-connectivity--default-ftp-session-factory-filled-in.png]] 110 - 111 -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. 112 - 113 -Now that we have configured the support object adding the FTP inbound channel adapter to the flow has become time. 114 - 115 -[[image:Main.Images.Microlearning.WebHome@intermediate-file-based-connectivity-ftp-connectivity--ftp-inbound-channel-adapter-empty.png]] 116 - 117 -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. 118 - 119 -[[image:Main.Images.Microlearning.WebHome@intermediate-file-based-connectivity-ftp-connectivity--ftp-inbound-channel-adapter-filled-in.png]] 120 - 121 -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. This concludes our microlearning, in which we learned how to set up the connectivity with an FTP. 122 - 123 123 == 4. Key takeaways == 124 124 125 125 * FTP (File Transfer Protocol) is a network protocol for transmitting files between computers over Transmission Control Protocol/Internet Protocol (TCP/IP) connections.