Limits of a Publisher when a topic and writer is conserned - c

Could anyone let me know if one publisher can be used for passing different parameters (Data Types), like integer, float, string, char etc...
Does Open Splice DDS Community edition have any limitations for publishers? If so how many publishers can it accommodate?
<OpenSplice>
<Domain>
<Name>ospl_sp_ddsi</Name>
<Id>0</Id>
<SingleProcess>true</SingleProcess>
<Service name="ddsi2">
<Command>ddsi2</Command>
</Service>
<Service name="durability">
<Command>durability</Command>
</Service>
<Service enabled="false" name="cmsoap">
<Command>cmsoap</Command>
</Service>
</Domain>
<DDSI2Service name="ddsi2">
<General>
<NetworkInterfaceAddress>192.168.147.179</NetworkInterfaceAddress>
<AllowMulticast>true</AllowMulticast>
<EnableMulticastLoopback>true</EnableMulticastLoopback>
<CoexistWithNativeNetworking>false</CoexistWithNativeNetworking>
</General>
<Compatibility>
<!-- see the release notes and/or the OpenSplice configurator on DDSI interoperability -->
<StandardsConformance>lax</StandardsConformance>
<!-- the following one is necessary only for TwinOaks CoreDX DDS compatibility -->
<!-- <ExplicitlyPublishQosSetToDefault>true</ExplicitlyPublishQosSetToDefault> -->
</Compatibility>
</DDSI2Service>
<DurabilityService name="durability">
<Network>
<Alignment>
<TimeAlignment>false</TimeAlignment>
<RequestCombinePeriod>
<Initial>2.5</Initial>
<Operational>0.1</Operational>
</RequestCombinePeriod>
</Alignment>
<WaitForAttachment maxWaitCount="10">
<ServiceName>ddsi2</ServiceName>
</WaitForAttachment>
</Network>
<NameSpaces>
<NameSpace name="defaultNamespace">
<Partition>*</Partition>
</NameSpace>
<Policy alignee="Initial" aligner="true" durability="Durable" nameSpace="defaultNamespace"/>
</NameSpaces>
</DurabilityService>
<TunerService name="cmsoap">
<Server>
<PortNr>none</PortNr>
</Server>
</TunerService>
</OpenSplice>

A DDS-publisher can have multiple writers of different topics where each topic-type can include various parameters of various types (including bounded and unbounded types such as arrays and sequences).
The OpenSplice CE (Community Edition) doesn't have any limitation for publishers, but when you want to run more than 10 applications on a single machine you have to change the DDSI/Discovery/ParticipantIndex parameter from its default 'auto' value to 'none', see also this post: http://forums.opensp...index#entry4024
Cheers

Related

Testing DB2 Timestamp function in H2

I'm trying to make unit tests work in H2 for the DB2 function TIMESTAMP(Date, int) which sets the precision for the timestamp.
A similar question led me to
http://www.h2database.com/html/features.html#user_defined_functions
but I'm not sure how the overloading would work in this scenario.
Can anyone give me an example?
( Also, please don't answer just to say that having different databases for testing and production is bad practice. It's not something I'll be able to change :/ )
hi i had a native query with VALUE and INT functions i did the following steps:
1) Add on before the custom functions
#Before
public void addCustomFunctions() throws Exception{
Context context = new InitialContext();
DataSource dataSource =(DataSource) context.lookup("java:jboss/datasources/ejb3-junit-arguillian-exampleTestDS");
Connection conn = dataSource.getConnection("sa","sa");
Statement st = conn.createStatement();
st.execute("CREATE ALIAS INT FOR \"com.ec.custom.IntFunction.transformInt\"");
}
2) Add the class with a static public method
public class IntFunction {
public static Integer transformInt(Object object) {
Integer result = 0;
result = Integer.parseInt(object.toString());
return result;
}
}
3) The jndi for the datasource must exist on
java:jboss/datasources/ejb3-junit-arguillian-exampleTestDS
my persistence.xml
<?xml version="1.0" encoding="UTF-8"?>
<!--
JBoss, Home of Professional Open Source
Copyright 2013, Red Hat, Inc. and/or its affiliates, and individual
contributors by the #authors tag. See the copyright.txt in the
distribution for a full listing of individual contributors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<persistence version="2.0"
xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="
http://java.sun.com/xml/ns/persistence
http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd">
<persistence-unit name="primary">
<!-- We use a different datasource for tests, so as to not overwrite
production data. This is an unmanaged data source, backed by H2, an in memory
database. Production applications should use a managed datasource. -->
<!-- The datasource is deployed as WEB-INF/test-ds.xml,
you can find it in the source at src/test/resources/test-ds.xml -->
<jta-data-source>java:jboss/datasources/ejb3-junit-arguillian-exampleTestDS</jta-data-source>
<properties>
<!-- Properties for Hibernate -->
<property name="hibernate.hbm2ddl.auto" value="create-drop" />
<property name="hibernate.show_sql" value="false" />
</properties>
</persistence-unit>
</persistence>
You can follow the guide of arquillian its what i used.
https://github.com/monk8800/ejb3-junit-arguillian-example

Problems while using ANT for creating HTML (junit style) report

I am trying to generate an HTML/Junit Style report for the jMeter tests by using ANT. I have created a build file for this and have done all the pre-requisites like:
set the required variables like java home, ant home, path variables; put the ant build file and the required .jmx file (for jmeter execution) in a folder and calling "ant" command pointing at the same folder.
I tried calling the ant build file by giving commands as ant and ant -Dtest="Sample Workload Script".
The issue i get is that when i run this commands it reaches to the point of executing the test plan and then gives a java platform error (as shown in attached image) and stops the build. Any pointers to what might be causing this?
Java Platform Error when running the ANT Build file
I read somewhere that the ANT version may not be compatible with java 1.8. Speaking of which i am using Ant 1.9.7 and java 1.8.73
My build file:
<?xml version="1.0"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<project name="ant-jmeter" default="all">
<description>
Sample build file for use with ant-jmeter.jar
See http://www.programmerplanet.org/pages/projects/jmeter-ant-task.php
To run a test and create the output report:
ant -Dtest=script
To run a test only:
ant -Dtest=script run
To run report on existing test output
ant -Dtest=script report
The "script" parameter is the name of the script without the .jmx suffix.
Additional options:
-Dshow-data=y - include response data in Failure Details
-Dtestpath=xyz - path to test file(s) (default user.dir).
N.B. Ant interprets relative paths against the build file
-Djmeter.home=.. - path to JMeter home directory (defaults to parent of this build file)
-Dreport.title="My Report" - title for html report (default is 'Load Test Results')
Deprecated:
-Dformat=2.0 - use version 2.0 JTL files rather than 2.1
</description>
<property name="testpath" value="${user.dir}"/> <!--<property name="testpath" value="${user.dir}"/>-->
<property name="jmeter.home" value="C:\apache-jmeter-3.0"/>
<property name="report.title" value="Load Test Results"/>
<!-- Name of test (without .jmx) -->
<property name="test" value="Test"/>
<!-- Should report include response data for failures? -->
<property name="show-data" value="n"/>
<property name="format" value="2.1"/>
<condition property="style_version" value="">
<equals arg1="${format}" arg2="2.0"/>
</condition>
<condition property="style_version" value="_21">
<equals arg1="${format}" arg2="2.1"/>
</condition>
<condition property="funcMode">
<equals arg1="${show-data}" arg2="y"/>
</condition>
<condition property="funcMode" value="false">
<not>
<equals arg1="${show-data}" arg2="y"/>
</not>
</condition>
<!-- Allow jar to be picked up locally -->
<path id="jmeter.classpath">
<fileset dir="${basedir}">
<include name="ant-jmeter*.jar"/>
</fileset>
</path>
<taskdef
name="jmeter"
classname="org.programmerplanet.ant.taskdefs.jmeter.JMeterTask"/>
<!--classpathref="jmeter.classpath"-->
<!--classpathref="C:\apache-jmeter-3.0\extras"-->
<target name="all" depends="run,report"/>
<target name="run">
<echo>funcMode = ${funcMode}</echo>
<delete file="${testpath}/${test}.html"/>
<jmeter
jmeterhome="${jmeter.home}"
testplan ="${basedir}/${test}.jmx"
resultlog="${basedir}/${test}.jtl">
<!--
<jvmarg value="-Xincgc"/>
<jvmarg value="-Xmx128m"/>
<jvmarg value="-Dproperty=value"/>
<jmeterarg value="-qextra.properties"/>
-->
<!-- Force suitable defaults -->
<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}"/>
</jmeter>
</target>
<property name="lib.dir" value="${jmeter.home}/lib"/>
<!-- Use xalan copy from JMeter lib directory to ensure consistent processing with Java 1.4+ -->
<path id="xslt.classpath">
<fileset dir="${lib.dir}" includes="xalan*.jar"/>
<fileset dir="${lib.dir}" includes="serializer*.jar"/>
</path>
<target name="report" depends="xslt-report,copy-images">
<echo>Report generated at ${report.datestamp}</echo>
</target>
<target name="xslt-report" depends="_message_xalan">
<tstamp><format property="report.datestamp" pattern="yyyy/MM/dd HH:mm"/></tstamp>
<xslt
classpathref="xslt.classpath"
force="true"
in="${basedir}/${test}.jtl"
out="${basedir}/${test}.html"
style="${basedir}/jmeter-results-detail-report${style_version}.xsl">
<param name="showData" expression="${show-data}"/>
<param name="titleReport" expression="${report.title}"/>
<param name="dateReport" expression="${report.datestamp}"/>
</xslt>
</target>
<!-- Copy report images if needed -->
<target name="copy-images" depends="verify-images" unless="samepath">
<copy file="${basedir}/expand.png" tofile="${testpath}/expand.png"/>
<copy file="${basedir}/collapse.png" tofile="${testpath}/collapse.png"/>
</target>
<target name="verify-images">
<condition property="samepath">
<equals arg1="${testpath}" arg2="${basedir}" />
</condition>
</target>
<!-- Check that the xalan libraries are present -->
<condition property="xalan.present">
<and>
<!-- No need to check all jars; just check a few -->
<available classpathref="xslt.classpath" classname="org.apache.xalan.processor.TransformerFactoryImpl"/>
<available classpathref="xslt.classpath" classname="org.apache.xml.serializer.ExtendedContentHandler"/>
</and>
</condition>
<target name="_message_xalan" unless="xalan.present">
<echo>Cannot find all xalan and/or serialiser jars</echo>
<echo>The XSLT formatting may not work correctly.</echo>
<echo>Check you have xalan and serializer jars in ${lib.dir}</echo>
</target>
</project>
Update "jmeter" section of your build.xml file as follows:
<jmeter
jmeterhome="${jmeter.home}"
testplan ="${basedir}/${test}.jmx"
resultlog="${basedir}/${test}.jtl"
jmeterlogfile="${basedir}/jmeter.log"> <!-- add this line to enabled logging-->
Re-run your test and look into jmeter.log file under your C:\workspace\CPT folder - it should contain enough troubleshooting information so you will be able to find out the cause. If you have problems interpreting the log file - add it to your question.
References:
JMeter Ant Task
Five Ways To Launch a JMeter Test without Using the JMeter GUI

How to fix inconsistency in Jackrabbit JCR (BundleFsPersistenceManager)

We are using JackRabbit in production. Unfortunately we have some inconsistencies in the repositories which make the data not unreadable:
ERROR ResourceServiceImpl - RepositoryException to JCR javax.jcr.PathNotFoundException: 1661b5c
The spring bean configuration looks like this:
<bean id="repository" class="org.apache.jackrabbit.core.RepositoryImpl" destroy-method="shutdown">
<constructor-arg index="0" ref="config" />
</bean>
<bean id="config" class="org.apache.jackrabbit.core.config.RepositoryConfig" factory-method="create">
<constructor-arg index="0" ref="jcrXml"/>
<constructor-arg index="1" value="${instance.repository}" />
</bean>
<bean id="jcrXml" class="com.example.misc.InputStreamBeanFactory" factory-method="createStream">
<constructor-arg value="/jackrabbit-repository.xml" />
</bean>
<bean name="jcrSession" factory-bean="repository" factory-method="login" scope="session" destroy-method="logout" />
The workspaces.xml looks like this:
<?xml version="1.0" encoding="UTF-8"?><Workspace name="default">
<FileSystem class="org.apache.jackrabbit.core.fs.local.LocalFileSystem">
<param name="path" value="${wsp.home}"/>
</FileSystem>
<PersistenceManager class="org.apache.jackrabbit.core.persistence.bundle.BundleFsPersistenceManager"/>
</Workspace>
From what I've learned (too late) here, the above configured BundleFsPersistenceManager can become inconsistent. It is also writen here that this should NOT be used into production. Well, it is now in production and no one has noticed this before and we would like to exchange this. However first we have to migrate the data and for this reason we need to fix it.
My question: Is there a way to fix this or are these data lost for good?
My second question: What can we do to avoid these issues in the future?.
There's some notes about additional check.. params that can be set on persistence managers on Adobe CQ - Repository Inconsistency (uses Jackrabbit). The Magnolia - JCR Troubles has a script example for searching for and removing broken nodes. I've seen an approach that combined the logic from this script (written in java) and the checking params allow for a repository to be brought back up and running long enough to get the content out.
To avoid the issues in future - where you want a standalone setup that doesn't use a RDBMS - I'd suggest org.apache.jackrabbit.core.persistence.pool.DerbyPersistenceManager.
<PersistenceManager class="org.apache.jackrabbit.core.persistence.pool.DerbyPersistenceManager">
<param name="url" value="jdbc:derby:${wsp.home}/db;create=true"/>
<param name="schemaObjectPrefix" value="${wsp.name}_"/>
</PersistenceManager>

Another "The maximum string content length quota (8192) has been exceeded while reading XML data." issue with WCF and Silverlight 4

I have no trouble retrieving a large amount of data, but sending it back to the service displays this error. I've tried adding the element to both the web.config and servicereferences.clientconfig and it's not recognized in either. At one point I got a message about adding readerQuotas to bindingElementExtensions, but I can't find anything useful on how to do this. I found posts saying I had to modify the devenv.exe.config and such, but doing that hosed VS.
Edit
Here's the binding section of the web.config:
<bindings>
<customBinding>
<binding name="QaRiM.Web.Service1.customBinding0">
<binaryMessageEncoding />
<httpTransport maxReceivedMessageSize="2147483647" maxBufferSize="2147483647" />
</binding>
</customBinding>
</bindings>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true"
multipleSiteBindingsEnabled="true" />
<services>
<service name="QaRiM.Web.Service1">
<endpoint address="" binding="customBinding" bindingConfiguration="QaRiM.Web.Service1.customBinding0"
contract="QaRiM.Web.Service1" />
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
</service>
</services>
and the servicereferences.clientconfig:
<configuration>
<system.serviceModel>
<bindings>
<customBinding>
<binding name="CustomBinding_Service1">
<binaryMessageEncoding />
<httpTransport maxReceivedMessageSize="2147483647" maxBufferSize="2147483647" />
</binding>
</customBinding>
</bindings>
<client>
<endpoint address="http://localhost:36533/Service1.svc" binding="customBinding"
bindingConfiguration="CustomBinding_Service1" contract="ServiceReference1.Service1"
name="CustomBinding_Service1" />
</client>
</system.serviceModel>
</configuration>
Both were generated by VS.
You are simply missing the configuration for the maximum string content length.
Add this to your binding attributes (client and server)
<readerQuotas maxStringContentLength="2147483647" />
Sorry, I didn't realize that this child element is located under the encoding being used when using a custom binding, it appears to bebinaryMessageEncoding in your example. If not, try the other encodings with the setting.
<bindings>
<customBinding>
<binding name="QaRiM.Web.Service1.customBinding0">
<binaryMessageEncoding>
<readerQuotas maxStringContentLength="2147483647"/>
</binaryMessageEncoding>
</binding>
</customBinding>
</bindings>
if The maximum string content length quota (8192) has been exceeded while reading XML data.” is ignoring your web.config settings EVEN after you set
you can also solve the problem in your code by creating an instance of XmlDictionaryReaderQuotas and setting the MaxStringContentLength to 2147483647
then just use the instance of XmlDictionaryReaderQuotas seen here as mycreatedreaderquota
XmlDictionaryReaderQuotas mycreatedreaderquota = new XmlDictionaryReaderQuotas();
mycreatedreaderquota.MaxStringContentLength = 2147483647;
XmlDictionaryReader reader = XmlDictionaryReader.CreateTextReader(stream, mycreatedreaderquota);
edit: This saved an incomplete draft, sorry
Synchronizing the service/client definitions is what you've done but it's definitely imperative that they match.
Are you sure you need custom binding? Have you tried using ws(Dual)HttpBinding as a base?
This post may be of interest: silverlight 3 wcf service configuration -- getting maxreceivedmessagesize error, specifically the httpRuntime maxRequestLength="2147483647" setting.
You may need to set maxBufferPoolSize and maxItemsInObjectGraph. The config in the linked SO post pretty much maxed everything out.
I don't know if you use the ChannelFactory client proxy method or the service reference method but you may wish to go the former route. In debug sessions I was finding certain values from the config weren't being applied as I had thought but my short term memory on the subject is rather lost now.
Related to #5 somewhat, you can run into WCF Test Client issues where the test client is using default bindings that you're not prepared for.
Another post that may be of interest: http://www.haveyougotwoods.com/archive/2008/04/14/wcf-message-streaming.aspx
Streaming is likely your best bet on the client side to keep from the blocking nature of buffered transferMode. I don't know the specifics of how big the data will be consistently but your service will behave a little nicer on the client end if you went that route. A good primer on configuring just the client side for streaming can be found here: http://systemmetaphor.blogspot.com/2009/05/using-wcf-to-transfer-large-data-files.html.
Hopefully some combination of the above helps
Have you tried setting the maxStringContentLength within the config for the service? In my situation, setting it on the service allowed for the Silverlight client to use the desired value for maxStringContentLength.
One note is that if you are allowing longer strings, but don't adjust the maxReceivedMessageSize, than this can cause issues as well. The maxReceivedMessageSize does need to be controlled on both the service and the client, as one will not inherit the values from another.

How to set WS-SecurityPolicy in an inbound CXF service in Mule?

When configuring the service for handling UsernameToken and signatures, it's setup like this:
<service name="serviceName">
<inbound>
<cxf:inbound-endpoint address="someUrl" protocolConnector="httpsConnector" >
<cxf:inInterceptors>
<spring:bean class="org.apache.cxf.binding.soap.saaj.SAAJInInterceptor" />
<spring:bean class="org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor">
<spring:constructor-arg>
<spring:map>
<spring:entry key="action" value="UsernameToken Timestamp Signature" />
<spring:entry key="passwordCallbackRef" value-ref="serverCallback" />
<spring:entry key="signaturePropFile" value="wssecurity.properties" />
</spring:map>
</spring:constructor-arg>
</spring:bean>
</cxf:inInterceptors>
</cxf:inbound-endpoint>
</inbound>
</service>
But how is it possible to create a policy of what algorithms that are allowed, and what parts of the message that should be signed?
You'd have to ask the Mule folks. Last I checked, they hadn't moved to CXF 2.2.x yet. If they ARE on 2.2.x, you could use the WS-SecPol support built into CXF.

Resources