IgniteConfiguration properties - do these properties still exist? - gridgain

When porting from gridgain to ignite, I can't find matching properties for the following in IgniteConfiguration. Have they been totally purged or is there something else we should be using ?
<bean id="abstractGridConfiguration" abstract="true"
class="org.apache.ignite.configuration.IgniteConfiguration">
.......
<!--<property name="restEnabled" value="false"/>-->
<!--<property name="executorServiceShutdown" value="true"/>-->
<!--<property name="systemExecutorServiceShutdown" value="true"/>-->

To disable REST add this:
<property name="connectorConfiguration"><null/></property>
As for the thread pools, in Ignite you can only specify sizes (see IgniteConfiguration.setXxxThreadPoolSize() properties). Thus having shutdown flags doesn't make sense anymore.

Related

Spring-integration convert xml configuration into java config

I want to convert my xml config into Java class config but i can't find a solution. For example a piece of my config:
<file:inbound-channel-adapter id="filesIn" directory="file:${java.io.tmpdir}/spring-integration-samples/input"
filename-regex="^.*\.(xml|json)$" >
<int:poller id="poller" fixed-delay="5000"/>
</file:inbound-channel-adapter>
<int:service-activator input-channel="filesIn"
output-channel="filesOut"
ref="handler"/>
<file:outbound-channel-adapter id="filesOut" directory="file:${java.io.tmpdir}/spring-integration-samples/output"
delete-source-files="true"/>
<file:inbound-channel-adapter id="filesContent" directory="file:${java.io.tmpdir}/spring-integration-samples/output"
filename-regex="^.*\.(xml|json)$" prevent-duplicates="true">
<int:poller id="poller2" fixed-delay="5000"/>
</file:inbound-channel-adapter>
How can i made the same thing but with use sftp (src directory) on my local machine and also how to write this config in java class. Give me any suggestion i looking for answer but i can't find the way out.
First of all you should start from the Spring Integration Java DSL Reference Manual. There you will find general concepts of the Java DSL and how that is related to the XML config.
The SFTP Inbound/Outbound Channel Adapter configuration samples you can find in the appropriate Reference Manual Chapter. For example that <int:service-activator> in Java DSL may look like:
.handle(handler)
Where you don't have channel definitions if you declare everything in a single IntegrationFLow.

Default and Specific config options in hazelcast with wildcards

I would like to be able to something like the following with a hazelcast config (in Scala):
.setMapConfigs(
Map(
"*Foo" → specificConfig
"*" → defaultConfig
)
)
So anything matching *Foo would get the specificConfig otherwise the default.
However, this doesn't seem to work and everything gets the default config including "*Foo" maps.
Is there a way to do this?
Hazelcast support wildcard for his configuration, in the name property.
See the documentation
In xml (but it's the same with a configuration in java/scala) :
<map name="default">
...
</map>
<map name="*Foo">
...
</map>

Bean Autowiring problem

I am starter in mutithreading. I am trying to index my data into solr.For that I was writing the following code
I am getting null pointer exception in the line highlighted
You need to add the following:
<context:annotation-config/>
You need to set the path for autowiring package scan and in your case it will be:
<context:component-scan base-package="a.b.c" />
After it you need to mark the class as candidate for autowiring:
#Component("indexTask")
#Scope("prototype")
IndexTask implements Callable<IndexObject>
{
//ommited
}
Next you can remove indexTask bean configuration from xml file. your package will be created automatically.
Hope it helps.
Autowiring doesn't happen automatically, you need to configure it. See the Spring docs for detail, but essentially you need to add
<context:annotation-config/>

WIX - RegistrySearch returns wrong Installlocation

My WIX-installer shall check for a previously installed version of the software. If there is an older installation it shall be installed in the same path. I'm using RegistrySearch to perform this check.
<Property Id="TARGETDIR">
<RegistrySearch Id="InstallLocation" Root="HKLM" Key="SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\[ANYVERSION]" Name="InstallLocation" Type="directory" Win64="no" />
</Property>
where [ANYVERSION] is defined in
<Upgrade Id="MyGUID">
<UpgradeVersion Property="OLDVERSION" IncludeMinimum="yes" IncludeMaximum="no" Maximum="$(var.VERSION)" Minimum="0.0.0.0" OnlyDetect="no" />
<UpgradeVersion Property="NEWVERSION" IncludeMinimum="no" Minimum="$(var.VERSION)" Maximum="99.99.99.99" IncludeMaximum="no" OnlyDetect="yes" />
<UpgradeVersion Property="EQUALVERSION" IncludeMinimum="yes" Minimum="$(var.VERSION)" Maximum="$(var.VERSION)" IncludeMaximum="yes" OnlyDetect="yes" />
<UpgradeVersion Property="ANYVERSION" IncludeMinimum="yes" Minimum="0.0.0.0" Maximum="99.99.99.99" IncludeMaximum="yes" OnlyDetect="yes" />
</Upgrade>
My check works fine when there is already another version of my software installed.
When there is no earlier installation of my software, the checks works as well with one exception: when there is another application installed which writes an entry (with the name installLocation) without subnode (GUID) in HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall the check returns the installLocation of this application.
What is wrong in my check?
Why is RegistrySearch returning the installLocation of the an entry without a subnode?
Is there a possibility to make this work with registrySearch, or do I need to write my own CustomAction?
That's because ANYVERSION will be empty if none is found, and the path will then be evaluated to HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall.
One solution (not too elegant though) is to capture the registry search in another property, and only set the property that should contain your installation directory (TARGETDIR is probably not the correct choice here either) if ANYVERSION is defined, through a property settings custom action.

Spring transactions - Mixing #Transactional with <tx:advice> into a custom annotation

My goal is to have some way of declaring my service classes as transactional. I dont want to leave it as an explicit declaration in spring configuration. Many times in past we have created new services and forgot to declare transactions around them. Hence my intention is that if i have something like #TransactionalService custom annotation, it should do the following :-
1. provides transactional support
2. declares some default rules for transactional support as spring currently provides as shown below. But unlike spring, i would like the below to be part of my #TransactionService annotation.
<tx:advice id="txAdvice" transaction-manager="txManager">
<tx:attributes>
<!-- all methods starting with 'get' are read-only -->
<tx:method name="get*" read-only="true"/>
<tx:method name="*"/>
Any advice would be valuable?
Sure, instead of creating a new annotation, you could just put your transactionnal services in the same package, and then your pointcut (only one for all you transactionnal services) will look like this :
<aop:config>
<aop:pointcut id="transactionnalServiceMethods" expression="execution(* x.y.transactionnalservice.*.*(..))"/>
<aop:advisor advice-ref="txAdvice" pointcut-ref="transactionnalServiceMethods"/>
</aop:config>
The advice is the same as above :
<tx:advice id="txAdvice" transaction-manager="txManager">
<tx:attributes>
<!-- all methods starting with 'get' are read-only -->
<tx:method name="get*" read-only="true"/>
<tx:method name="*"/>
</tx:attributes>
</tx:advice>

Resources