WSO2 ESB EI611 VFS ActionAfterProcess & ActionAfterFailure - options - wso2

Requirement is, not to move or delete the files after copying to a
different folder, leave it as it is, after copying the file and pick
up the latest files only
<parameter name="transport.vfs.ActionAfterFailure">MOVE</parameter>
<parameter name="transport.vfs.ActionAfterProcess">MOVE</parameter>
<parameter name="transport.vfs.ActionAfterFailure">DELETE</parameter>
<parameter name="transport.vfs.ActionAfterProcess">DELETE</parameter>
For inbound enpoint with protocol="file" the above paramaters and the options MOVE & DELETE are allowed. How do I add the option of NO ACTION ?
If this option(NO ACTION) is not possible with inbound endpoint, can we use proxy-service with transports="vfs" and use the no-action option? What's the syntax?
Documentation of WSO2 says, no action is possible as third option, but there's no syntax or format to it. Inbound Endpoint IDE properties, support only MOVE or DELETE. Proxy-service is a name-value pair.

Not sure it it works in EI6, but in ESB 4.8.1 you can do it like the following.
<parameter name="transport.vfs.ActionAfterProcess">NONE</parameter>

Thanks, I kinda expected that WSO2 purposely kept MOVE & DELETE as the only option, to avoid redundancy. Otherwise, the behavior or file polling will be erroneous. That's why they dropped "NONE", maybe to avoid picking up old files or files existing in the folder already. But, this should have been clear in the documentations, God, their docs is killing me.

Related

how change secured-="true" in identity.xml?

I want to change secured= true in following lines in identity.xml:
<Resource context="(.*)/authenticationendpoint(.*)" secured="false" http-method="all"/>
I added the following codes in deployment.toml, then restart WSO2 IS
[resource.access_control]
context="(.*)/authenticationendpoint(.*)"
secured="true"
http-method="all"
But, the result is FAIL.
Could you tell me what code I need add in deployment.toml ?
Thanks
henry
You can change a configuration via deployment.toml, only ifthat config is templated in the particular .j2 file.
If you go to
<IS-HOME>/repository/resources/conf/templates/repository/conf/identity/identity.xml.j2 file and check the line
<Resource context="(.*)/authenticationendpoint(.*)" secured="false" http-method="all"/>
it is hardcoded in the .j2 file also. So you won't be able to set secured="true" in this line by adding a config to deployment.toml.
The change can be only done by changing identity.xmlj2 file.
Also, note that it's not recommended to change the .j2 file if the configs are not templated, because it is the default behavior and only deployment.toml config will be looked at as the config changes.
An alternative option is:
Apply resource control access to the deployment.toml with different context which matches to the API path(not exact the context="(.)/authenticationendpoint(.)" but with a regex matching to the endpoint) under [[resource.access_control]]. The added config will reflect in identity.xml file at the beginning of the resource access controls. The first context match is applicable for a endpoint access control.

WSO2 vault-lookup Xpath expression returns Empty/Blank

when I do a simple expression like wso2:vault-lookup('my-token') it returns empty. But i have the my-token present in the vault.
Has anyone encountered this problem before ? Any possible workaround that you can suggest.
EI version 6.2.0
Can you try the following approach?
Run the ciphertool.sh with the following command.
bin/ciphertool.sh -Dorg.wso2.CipherTransformation=RSA/ECB/OAEPwithSHA1andMGF1Padding
Enter the plain text value which you need to encrypt and copy the encrypted value
Navigate to the carbon console and expand the registry browse section.
Go to the following path.
/_system/config/repository/components/secure-vault
Above is the location where the registry holds the secure vault properties and the values.
Inside the secure vault, create a new property with a name and paste the encrypted value which you acquired from the initial step.
Try to get the property from the mediation sequence.
wso2:vault-lookup('prop-name')
Since you have confirmed that this is working as expected in the vanilla version of the EI server, can you compare the configurations available in secret-conf.properties file located in [EI_HOME]/conf/security directory of the existing server and the vanilla pack (that this working).

Multiple lifecycles s3cmd

I want to have multiple lifecycles for many folders in my bucket.
This seems easy if I use web interface but this should be an automated process so, at least in my case, it must use s3cmd.
It works fine when I use:
s3cmd expire ...
But, somehow, everytime I run this my last lifecycle gets overwrited.
There's an issue on github:
https://github.com/s3tools/s3cmd/issues/863
My question is: is there another way?
You made me notice I had the exact same problem as you. Another way to access the expire rules with s3cmd is to show the lifecycle configuration of the bucket.
s3cmd getlifecycle s3://bucketname
This way you get some xml formatted text:
<?xml version="1.0" ?>
<LifecycleConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
<Rule>
<ID>RULEIDENTIFIER</ID>
<Prefix>PREFIX</Prefix>
<Status>Enabled</Status>
<Expiration>
<Days>NUMBEROFDAYS</Days>
</Expiration>
</Rule>
<Rule>
<ID>RULEIDENTIFIER2</ID>
<Prefix>PREFIX2</Prefix>
<Status>Enabled</Status>
<Expiration>
<Days>NUMBEROFDAYS2</Days>
</Expiration>
</Rule>
</LifecycleConfiguration>
If you put that text in a file, changing the appropriate fields (put identifiers of your choice, set the prefixes you want and the number of days until expiration), you now can use the following command (changing FILE for the path where you put the rules):
s3cmd setlifecycle FILE s3://bucketname
That should work (in my case, now I see several rules when I execute the getlifecycle command, although I do not know yet if the objects actually expire or not).

how to disable "transport.vfs.ActionAfterProcess" in WSO2 VFS Proxy

Is there any way to disable the paramater "transport.vfs.ActionAfterProcess" in VFS Proxy in WSO2 ESB? In my case I don't want the file to be moved or deleted. How can i do this? I tried not to include the "transport.vfs.ActionAfterProcess" parameter, but I think it has a default value so the file still moved or deleted.
The solution to this is to have the file moved back to the same directory, but if you have a polling system where you constantly check the input directory for new files, then you could have the processed filed saved with a different naming convention that would be filtered when files are taken in for processing.

How to log SQL values sent to my DB using EclipseLink?

I use EclipseLink as my JPA2 persistence layer, and i would like to see the values sent to DB in logs.
I already see SQL queries (using <property name="eclipselink.logging.level" value="ALL" /> in my persistence.xml), but, for example in an SQSL INSERT, I do not see the values, only the placeholders ?
So, how to see what values are sent
You'll need to use a JDBC proxy driver like p6spy or log4jdbc to get the SQL statements issued with their values instead of the placeholders. This approach works well you are using a EclipseLink with a connection pool whose URL is derived from persistence.xml (where you can specify a JDBC URL recognized by the proxy driver instead of the actual), but may not be so useful in a Java EE environment (atleast for log4jdbc), unless you can get the JNDI data sources to use the proxy driver.