cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Cloud Hot Folders

Former Member
0 Likes
7,058

Good morning experts, I need an help about the cloud hot-folders. The wiki suggests to add the azurecloudhotfolder extension to your Build Manifest. This extension automatically enables all other dependent extensions.

In the local environment I can't find the azurecloudhotfolder extension to add in the localextensions.xml, so this likely give me an exception when I start the server on the bean hotfolderInboundFileChannelMappings not found. Any tips?

Thanks

Accepted Solutions (0)

Answers (13)

Answers (13)

volkerb
Discoverer
0 Likes

Hi,

sorry bothering you with an old topic, but I still have some trouble with hotfolders. I cannot manage to setup different inbound folders for different type of input files. For instance, I would like to have two different folders under "master/hotfolder" called "A" and "B". So I would like to define the proper hotfolder inbound file channel mappings and the inbound channel adapters, respectively. I tried the following configuration without any luck, i.e. putting files into A or B does not trigger the processing. Any help is highly appreciated.


<bean id="baseDirectory" class="java.lang.String">
    <!--constructor-arg value="#{configurationService.configuration.getProperty('azure.hotfolder.local.sync.basefolder')}/${tenantId}"/-->
    <constructor-arg value="${HYBRIS_DATA_DIR}/azurecloudhotfolder/sync/master/hotfolder"/>
</bean>


<bean class="org.springframework.beans.factory.config.MethodInvokingFactoryBean">
    <property name="targetObject" ref="hotfolderInboundFileChannelMappings"/>
    <property name="targetMethod" value="put"/>
    <property name="arguments">
        <list>
            <bean class="java.util.regex.Pattern" factory-method="compile">
                <constructor-arg value="^.*" />
            </bean>
            <ref bean="batchFilesChannelA"/>
        </list>
    </property>
</bean>
<int:channel id="batchFilesChannelA"/>

<bean class="org.springframework.beans.factory.config.MethodInvokingFactoryBean">
    <property name="targetObject" ref="hotfolderInboundFileChannelMappings"/>
    <property name="targetMethod" value="put"/>
    <property name="arguments">
        <list>
            <bean class="java.util.regex.Pattern" factory-method="compile">
                <constructor-arg value="^.*" />
            </bean>
            <ref bean="batchFilesChannelB"/>
        </list>
    </property>
</bean>
<int:channel id="batchFilesChannelB"/>

<file:inbound-channel-adapter id="batchFilesChannelA" directory="#{baseDirectory}/A"
                              filename-regex="^(.*)-(\d+)\.csv" comparator="fileOrderComparator">
    <int:poller fixed-rate="5000"/>
</file:inbound-channel-adapter>

<file:inbound-channel-adapter id="batchFilesChannelB" directory="#{baseDirectory}/B"
                              filename-regex="^(.*)-(\d+)\.csv" comparator="fileOrderComparator">
    <int:poller fixed-rate="5000"/>
</file:inbound-channel-adapter>

anilkumar-reddy
Explorer
0 Likes

Hi botorabi, are you able to find a solution to implement this requirement? Like having more than one sub-folder for processing different files?

I'm looking for a solution to process same filetypes (.csv) but different sub-folders inside hotfolder.

Regards

snkogce
Discoverer
0 Likes
@Erhan for fix error you have to put following extensions to manifest json.



{
"commerceSuiteVersion": "1905",
"useCloudExtensionPack":true,
"disableImageReuse": true,
"extensions": [


"azurecloudhotfolder",
"cloudcommons",
"cloudhotfolder"],
0 Likes

Hi,

we had the same problem and contacted SAP for support. The answer was that this Custom-Mapping is related to cloud extension azurecloudhotfolder which does not exist OOTB (in hybris when we download it).
What we did in our project:
1. Activating spring profile in manifest.json under properties

"properties": [

{
"key": "spring.profiles.active",
"value": "cloud"
}
]

2. Added this Custom-Mapping they suggest in a separated beans tag with profile=cloud. Below that we added another beans section without profile attribute where standard hotfolder setup is placed. This way the bean mapping for cloud is only created on cloud and everything else is created every time. Hotfolder then works on cloud and locally too.

Here is dummy xml. I don't know if it works as this is just dummy but you should get the idea how to do it. hotfolder.txt

Former Member
0 Likes

Hi Everbody,

I need to configure custom hotfolder xml in CCV2. Below XML is my custom hotfolder xml . based on (https://help.sap.com/viewer/0fa6bcf4736c46f78c248512391eb467/SHIP/en-US/247827b9b70c449ead11e9419422...)

  <bean class="org.springframework.beans.factory.config.MethodInvokingFactoryBean">
       <property name="targetObject" ref="hotfolderInboundFileChannelMappings"/>
       <property name="targetMethod" value="put"/>
       <property name="arguments">
           <list>
               <bean class="java.util.regex.Pattern" factory-method="compile">
                   <constructor-arg value="^.*" />
               </bean>
               <ref bean="myInboundChannel"/>
           </list>
       </property>
   </bean>

   
     <constructor-arg value="#{baseDirectory}/${tenantId}/dgl"/>
 </bean>

 <!-- 1) Scan for files adapter : connect your channel to some other system -->
 <file:inbound-channel-adapter id="myInboundChannel" directory="#{baseDirectoryDglAsset}"
                               filename-regex="^.*\.(.*)$" comparator="fileOrderComparator" prevent-duplicates="false">
     <int:poller fixed-rate="2000"/>
 </file:inbound-channel-adapter>


 <!-- 2) move the file to input -->
 <file:outbound-gateway request-channel="myInboundChannel" requires-reply="false"
                        directory="#{myBaseDirectory}/input" delete-source-files="true" reply-channel="nullChannel"/>
 


-----------------------------------

Also I added manifest json :

"extensions": ["azurecloudhotfolder"]

.......

{ "name": "backgroundProcessing", "properties": [ { "key": "cluster.node.groups", "value": "integration,yHotfolderCandidate" } ] }


1.Question : I get an error at startup :

 org.springframework.beans.FatalBeanException: Context hybris Global Context Factory  couldn't  be created correctly due to, Error creating bean with name 'org.springframework.beans.factory.config.MethodInvokingFactoryBean#0' defined in class path resource [spring/dglproductimportservices-spring-hotfolder.xml]: Cannot resolve reference to bean 'hotfolderInboundFileChannelMappings' while setting bean property 'targetObject'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'hotfolderInboundFileChannelMappings' available



2.Question :

Let's say we solved the error above. Everthing is ok and I deploy ccv2. According to the this doc , When I put an image to the hybris/master/hotfolder folder in CCV2 Azure Blob Container ( please look at image attached) , then , related image is automatically moved to the my hotfolder "input" directory ( because I set in my hotfolder xml : directory="#{myBaseDirectory}/input" ) . Is this right expectation?


3.Question Let's say my expectation in 2.Question is true. Now another question ... As you know there are OOTB apparel and electronic hotfolder config's continue for electorinics hotfolder xml file.

 <bean id="baseDirectoryElectronics" class="java.lang.String">
         <constructor-arg value="#{baseDirectory}/${tenantId}/electronics" />
     </bean>
     <!-- 1) Scan for files -->
     <file:inbound-channel-adapter id="batchFilesElectronics" directory="#{baseDirectoryElectronics}"
         filename-regex="^(.*)-(\d+)\.csv" comparator="fileOrderComparator">
         <int:poller fixed-rate="1000" />
     </file:inbound-channel-adapter>
 
     <!-- 2) move the file to processing and setup header -->
     <file:outbound-gateway request-channel="batchFilesElectronics" reply-channel="batchFilesElectronicsProc"
         directory="#{baseDirectoryElectronics}/processing" delete-source-files="true" />
     <int:service-activator input-channel="batchFilesElectronicsProc" output-channel="batchFilesHeaderInit"
         ref="electronicsHeaderSetupTask" method="execute" />
     <bean id="electronicsHeaderSetupTask" class="de.hybris.platform.acceleratorservices.dataimport.batch.task.HeaderSetupTask">
         <property name="catalog" value="electronicsProductCatalog" />
         <property name="net" value="false" />
         <property name="storeBaseDirectory" ref="baseDirectoryElectronics" />
     </bean>

And If I upload a file like abc-01.csv , this file will go directly to the electronics hotfolder. What will happen for my custom hotfolder config. Please look at my custom hotfolder xml again , you will see this config :

 <constructor-arg value="^.*" />

In this situation, I will not take the "abc-01.csv" file. How can I prevent this? Means should I disable apparel and electronic hotfolder config ? If so , how ?

Thank you for your time and patience.

Former Member
0 Likes

Hi Erhan,

were you able to solve this yet? Especially first question? Would be interested in the solution. For me it sounds like i have to define a dependency inside the manifest file.

Best regards

Simon

Former Member
0 Likes

Hi,

Can you give more info about the setup of hot-folder-spring.xml file? We're having issues with the setup of hot folder for cloud version 2.

Does anyone have an example spring file?

I'm able to run it locally. But not able to connect with Microsoft Azure blob storage.

Thanks Dieter

kuberpant1
Explorer
0 Likes

Hey Guys,

Cloud Hot folder import is working fine for us but if we do any customisation by adding new bean definitions the import doesn't work. Is there any limitation with the cloud hot folder import where the import doesn't work with any new bean definitions?

Does anyone facing similar issue ? Any help would be appreciated.

Former Member
0 Likes

Thank you... I was able to proceed now.. the files are picked from my folder now. seems like some more gap in my configuration, i am seeing "unable to setup site in session." Will update back once i proceed further.

Former Member
0 Likes

oh yeah missed this, i will add and try

Private_Member_63124
Participant
0 Likes

Have you added this code in hot-folder-spring.xml ?

 <bean class="org.springframework.beans.factory.config.MethodInvokingFactoryBean">
     <property name="targetObject" ref="hotfolderInboundFileChannelMappings"/>
     <property name="targetMethod" value="put"/>
     <property name="arguments">
         <list>
             <bean class="java.util.regex.Pattern" factory-method="compile">
                 <constructor-arg value="^yourHotFolderPattern.*" />
             </bean>
             <ref bean="yourHotFolderChannel"/>               
         </list>
     </property>
 </bean>
kuberpant1
Explorer
0 Likes

Hi Pablo,

When we add this code in hot-folder.xml server start up is failing because 'hotfolderInboundFileChannelMappings' is not available.

Cloud Hot folder import is working fine for us but if we do any customisation by adding new bean definitions the import doesn't work. Do you know any limitation with the cloud hot folder import where the import doesn't work with any new bean definitions?

Cheers

Former Member
0 Likes

This is my entry in the hot folder spring. I edited the property dynamically in HAC, may be i need to add that in manifest.json and deploy ?

     <constructor-arg value="#{baseDirectory}/${tenantId}/abcde" />
 </bean>

and the value for that property : ${tenantId}/abcde

But still it is not picking the files..

Private_Member_63124
Participant
0 Likes

You have to configure the hotfolder like a not cloud environment (hot-folder-spring.xml), and then configure manifest property: azure.hotfolder.storage.container.hotfolder with same value as this property in xml: property name="storeBaseDirectory"

Wiki info about this subject is very bad.

Former Member
0 Likes

any success on this, i am trying to do the same. i am able to add the required extension, access the Azure blob, place the file. The file is getting picked but ending up with failure "was not routed as didn't match any configurations"

tanuja_syal
Discoverer
0 Likes

Hey , I am also trying to setup Cloud hot folder in local. Enabled extension "<extension name='azurecloudhotfolder' />" in localextensions.xml but gives following error:

" Invalid bean definition with name 'cloudHotFolderMediaConverter' defined in class path resource [cloudhotfolder/integration/hot-folder-default-mapping.xml]:"

Any idea , what Am I missing ?

former_member27
Product and Topic Expert
Product and Topic Expert
0 Likes

Hi Kavitha,

Thank you for visiting SAP Community to get answers to your questions. Since you're asking a question here for the first time please note that:

You are adding a comment to an old post that is not likely to get an answer.

I suggest starting a new question and following these guidelines:

I recommend that you familiarize yourself with: https://community.sap.com/resources/questions-and-answers, as it provides tips for preparing questions that draw responses from our members.

For example, you can:

- outline what steps you took to find answers (and why they weren't helpful) add this thread link as a reference for what you found.

- share screenshots of what you've seen/done

- make sure you've applied the appropriate tags

- use a more descriptive subject line

The more details you provide, the more likely it is that members will be able to respond. Feel free to also take our Q&A tutorial at: https://developers.sap.com/tutorials/community-qa.html

Should you wish, you can revise your question by selecting Actions, then Edit.

By adding a picture to your profile you encourage readers to respond: https://developers.sap.com/tutorials/community-profile.html

Regards,

Dedi

Private_Member_63124
Participant
0 Likes

Hi , There are some extensions in cloud that you can't see in your local installation. You have to add azurecloudhotfolder in manifest.json not in localextensions.

bye