I want to attach a PDF and send an email.
Following is my properties-local.xml files
<properties xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:oxf="http://www.orbeon.com/oxf/processors">
<property as="xs:string" name="oxf.fr.detail.buttons.*.*" value="send"/>
<property as="xs:boolean" name="oxf.fr.detail.send.email.*.*" value="true"/>
<!-- Email configuration -->
<property as="xs:string" name="oxf.fr.email.smtp.host.*.*" value="smtp.gmail.com"/>
<property as="xs:string" name="oxf.fr.email.from.*.*" value="#gmail.com"/>
<property as="xs:string" name="oxf.fr.email.to.*.*" value="#gmail.com"/>
<property as="xs:string" name="oxf.fr.email.smtp.username.*.*" value="#gmail.com"/>
<property as="xs:string" name="oxf.fr.email.smtp.credentials.*.*" value="123"/>
<property as="xs:string" name="oxf.fr.email.smtp.encryption.*.*" value="tls"/>
<property as="xs:string" name="oxf.fr.email.smtp.port.*.*" value="587"/>
<property as="xs:string" name="oxf.fr.resource.*.*.en.email.subject" value="Orbeon Form submission"/>
<property as="xs:string" name="oxf.fr.resource.*.*.en.email.body" value="Orbeon Form submission"/>
<property
as="xs:string"
name="oxf.fr.resource.*.*.en.detail.buttons.send"
value="Fancy Send"/>
<property as="xs:boolean" name="oxf.fr.email.attach-pdf.*.*" value="true"/>
<property as="xs:boolean" name="oxf.fr.email.attach-tiff.*.*" value="false"/>
<property as="xs:boolean" name="oxf.fr.email.attach-xml.*.*" value="true"/>
<property
as="xs:string"
name="oxf.fr.detail.process.send.*.*"
value='require-valid
then pdf
then email
then send("http://www.google.com/")
then navigate("/success")
recover navigate("/failure")'/>
</properties>
But system always navigate to failure. I couldn't find any errors in orbeon.log files.
Are there any additional setting that I need to configure?
Related
I my web application ,BoneCP DB connection pool configuration as following, it is creating too may DB connection
I need to know what is the default number of DB connection below configuration created
What is the optimal BoneCP configuration( avoiding unwanted connection)
<bean id="appDataSource" class="com.jolbox.bonecp.BoneCPDataSource" destroy-method="close">
<property name="driverClass" value="${database.driverClassName}" />
<property name="jdbcUrl" value="${database.url}" />
<property name="username" value="${database.username}"/>
<property name="password" value="${database.password}"/>
<!--<property name="idleConnectionTestPeriodInMinutes" value="2"/>-->
<property name="maxConnectionsPerPartition" value="15"/>
<property name="minConnectionsPerPartition" value="1"/>
<property name="partitionCount" value="4"/>
<property name="acquireIncrement" value="2"/>
<property name="statementsCacheSize" value="100"/>
<property name="releaseHelperThreads" value="5"/>
</bean>
I am trying to add encryption in properties file, The content is not getting decrypt
My Spring DSL looks like:
<bean id="jasypt" class="org.apache.camel.component.jasypt.JasyptPropertiesParser">
<property name="password" value="test"/>
<property name="algorithm" value="PBEWithMD5AndDES"/>
</bean>
<!-- define the camel properties component -->
<bean id="properties" class="org.apache.camel.component.properties.PropertiesComponent">
<!-- the properties file is in the classpath -->
<property name="location" value="classpath:my-properties.properties"/>
<!-- and let it leverage the jasypt parser -->
<property name="propertiesParser" ref="jasypt"/>
</bean>
<bean class="org.apache.activemq.ActiveMQConnectionFactory" id="jmsFactory">
<property name="brokerURL" value="tcp://localhost:61616"/>
<property name="userName" value="${jboss.fuse.username}"/>
<property name="password" value="${jboss.fuse.password}"/>
</bean>
my-properties.properties
jboss.fuse.username=ENC(D0hnlLDZfGPiC6DtU+NKog==)
jboss.fuse.password=ENC(D0hnlLDZfGPiC6DtU+NKog==)
Error message : java.lang.SecurityException: User name [ENC(D0hnlLDZfGPiC6DtU+NKog==)] or password is invalid.
PropertiesComponent doesn't work.It should be BridgePropertyPlaceholderConfigurer if you are using Spring DSL
<bean
class="org.apache.camel.spring.spi.BridgePropertyPlaceholderConfigurer" id="bridgePropertyPlaceholder">
<property name="location" value="classpath:my-properties.properties"/>
<property name="parser" ref="jasypt"/>
</bean>
I would like to ask if you know what needs to be set to end up Jmeter html report which includes request-response data(JSON) both success/error. I tried with following setting, but did not helped:
jmeter.properties
jmeter.save.saveservice.output_format=xml
jmeter.save.saveservice.data_type=true
jmeter.save.saveservice.label=true
jmeter.save.saveservice.response_code=true
jmeter.save.saveservice.response_data=true
jmeter.save.saveservice.response_data.on_error=true
jmeter.save.saveservice.response_message=true
jmeter.save.saveservice.successful=true
jmeter.save.saveservice.assertions=true
jmeter.save.saveservice.samplerData=true
jmeter.save.saveservice.responseHeaders=true
jmeter.save.saveservice.requestHeaders=true
tried to force them in ant build.xml
<!-- Force suitable defaults -->
<property name="request.threads" value="1"/>
<property name="request.threads" value="1"/>
<property name="request.loop" value="1"/>
<property name="jmeter.save.saveservice.data_type" value="true"/>
<property name="jmeter.save.saveservice.label" value="true"/>
<property name="jmeter.save.saveservice.response_code" value="true"/>
<property name="jmeter.save.saveservice.response_data" value="true"/>
<property name="jmeter.save.saveservice.response_message" value="true"/>
<property name="jmeter.save.saveservice.successful" value="true"/>
<property name="jmeter.save.saveservice.assertions" value="true"/>
<property name="jmeter.save.saveservice.samplerData" value="true"/>
<property name="jmeter.save.saveservice.responseHeaders" value="true"/>
<property name="jmeter.save.saveservice.requestHeaders" value="true"/>
<property name="jmeter.save.saveservice.output_format" value="xml"/>
<property name="jmeter.save.saveservice.assertion_results" value="all"/>
<property name="jmeter.save.saveservice.bytes" value="true"/>
<property name="file_format.testlog" value="${format}"/>
<property name="jmeter.save.saveservice.response_data.on_error"value="${funcMode}"/>
enter code here
Thanks
The fastest and the easiest solution is adding an empty response assertion applied to all requests like:
When your test ends you will see something like:
As a side-effect it will cause all samplers failure
See How to Use JMeter Assertions in Three Easy Steps article for more information on using Assertions to conditionally set pass/fail criteria.
If you would like to add response data and not to fail the sampler, it is more XSLT related question as you will need to amend the XSL stylesheet file in order to add an extra column
I have been using myBatis with org.apache.commons.dbcp.BasicDataSource as the data source.
for some reason, even under an impossible load, myBatis uses only a few connections from the pool (around 23).
As you can see below my initial size of connections is 50, but some of them just stay idle.
Any ideas what could be causing this?
<bean id="myDataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
<property name="driverClassName" value="com.mysql.jdbc.Driver"/>
<property name="url" value="#{'jdbc:mysql://' + mysql + ':3306/mydb?autoReconnect=true'}"/>
<property name="username" value="user"/>
<property name="password" value="pass"/>
<property name="validationQuery" value="SELECT 1"/>
<property name="testOnBorrow" value="true"/>
<property name="maxWait" value="5000"/>
<property name="initialSize" value="50"/>
<property name="maxIdle" value="50"/>
<property name="maxActive" value="1000"/>
</bean>
<bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">
<property name="dataSource" ref="myDataSource"/>
<property name="configLocation" value="classpath:mybatisConfiguration.xml"/>
</bean>
I want to download an XML file from a Web site using WSO2 ESB. Assume that the URL is static for the sake of simplicity.
I have tried VFS both as a proxy service and an individual sequence without success, and couldn't find any relevant material on the Internet.
Here is the sequence XML:
<sequence xmlns="http://ws.apache.org/ns/synapse" name="download">
<in>
<log level="headers">
<property name="?" value="[download] in: started"/>
</log>
<property name="OUT_ONLY" value="true" scope="default" type="STRING"/>
<property name="transport.vfs.ContentType" value="text/xml" scope="transport" type="STRING"/>
<property name="transport.vfs.FileURI" value="http://static.nvd.nist.gov/feeds/xml/cve/nvdcve-2.0-2013.xml" scope="transport" type="STRING"/>
<log level="headers">
<property name="?" value="[download] in: sending over vfs"/>
</log>
<send>
<endpoint>
<address uri="http://static.nvd.nist.gov/feeds/xml/cve/nvdcve-2.0-2013.xml"/>
</endpoint>
</send>
<log level="headers">
<property name="?" value="[download] in: ended"/>
</log>
</in>
<out>
<log level="headers">
<property name="?" value="[download] out: started"/>
</log>
<send/>
<log level="headers">
<property name="?" value="[download] out: ended"/>
</log>
</out>
</sequence>
So, how to download a large file over HTTP with WSO2 ESB?
I have a similar problem, and by the moment I've solved it with an API and this code:
<api xmlns="http://ws.apache.org/ns/synapse" name="EcoRest" context="/services/ecorest">
<resource methods="GET" uri-template="/{idFile}">
<inSequence>
<send>
<endpoint>
<http method="get" uri-template="http://slx00012001:8888/repositoryfiles/{uri.var.idFile}">
<suspendOnFailure>
<errorCodes>101500,101510,101001,101000</errorCodes>
<initialDuration>10</initialDuration>
<progressionFactor>1.0</progressionFactor>
<maximumDuration>10</maximumDuration>
</suspendOnFailure>
</http>
</endpoint>
</send>
<property name="enableSwA" value="true" scope="axis2"></property>
</inSequence>
<faultSequence>
<log level="custom">
<property name="FAULT GETTING FILE" expression="get-property('uri.var.idFile')"></property>
</log>
<payloadFactory media-type="json">
<format> {"descError":"$1", "error": "true"} </format>
<args>
<arg evaluator="json" expression="$.descError"></arg>
</args>
</payloadFactory>
<property name="HTTP_SC" value="500" scope="axis2" type="STRING"></property>
<respond></respond>
</faultSequence>
</resource>
</api>
This API works perfectly and make a throught-pass with the files. But if I send an id_file doesn't exist, the backend service return an http 400 with a json-message, the process go into the faultsequence, but the payloadFactory in the faultsequence doesn't work, and I don't know why :(
Have a go with this configuration:
<proxy xmlns="http://ws.apache.org/ns/synapse" name="download" transports="https,http,vfs" statistics="disable" trace="disable" startOnLoad="true">
<target>
<inSequence>
<property name="OUT_ONLY" value="true" scope="default" type="STRING"/>
<property name="ClientApiNonBlocking" value="true" scope="axis2" action="remove"/>
<send>
<endpoint>
<address uri="vfs:file://home/secondary/file.xml"/>
</endpoint>
</send>
</inSequence>
</target>
<parameter name="transport.vfs.Streaming">true</parameter>
<parameter name="transport.vfs.FileURI">http://static.nvd.nist.gov/feeds/xml/cve/nvdcve-2.0-2013.xml</parameter>
<parameter name="transport.vfs.Locking">disable</parameter>
<description></description>
</proxy>
You can initiate the download using:
curl -v http://localhost:8280/services/download
You can find out more about the VFS Transport specific parameters here: http://docs.wso2.org/wiki/display/ESB460/VFS+Transport. You can also find another VFS example here: http://docs.wso2.org/wiki/pages/viewpage.action?pageId=16846489. Hope this helps.