how to use multiple services in a single release - java

I am using Microservices for a single release. Normally, I have a Version.json file which Jenkins gets the versions of microservices of each release and publish these multiple services.
Is there any other way to do it except using Version.json file ?
Thanks

Doing single release with microservices is an anti-pattern. Therefore there is no ideal answer to your question.
If you want to get rid of one centralized Version.json file, I would suggest, keeping microservice version separate in each microservice project/repository. Qhen doing release Jenkins would just look into each released microservice repository and extract version from there. :)
Instead of Version.json in Jenkins:
{
"microservice_a": "1.2.3",
"microservice_b": "2.3.4"
}
You would have:
Version.json in microservice_a repo:
"1.2.3"
Version.json in microservice_b repo:
"2.3.4"

Related

Dependency tracker marks activemq-broker as vulnerable

I use spring-boot-starter-activemq with the lastest version of springboot (2.7.1). Our company's dependency tracker marks activemq-broker which is part of the starter as vulnerable because of CVE-2015-3208 (XML external entity - XXE). We use ActiveMQ instead of Artemis for integration with some legacy system. Is there a way to fix it or is this just a false positive ? I see that that there are updates in maven repository quite frequently (link) hence I can't believe that the vulnerability published in 2017 is not solved yet.
Thank you for your thoughts !

Fail to replace kubernetes statefulsets using fabric8 maven plugin

We use fabric8-maven-plugin to manage the full lifecycle of all of our kubernetes services. We are having a problem upgrading statefulsets (similar to this post but we dont use the kubernetes-client). The version of the maven plugin is 4.3.1. We have no issues with daemonsets but I just cant find a way to update statefulsets. We get the same error as the afore mentioned post.
Forbidden: updates to statefulset spec for fields other than 'replicas', 'template', and 'updateStrategy' are forbidden..
I have tried to set the updateStrategy to rolling but that doesn't seem to do anything.
Thanks Paul

Does Artifactory store whole configuration in artifactory.config.latest.xml?

I am using Docker and NuGet repositories in Artifactory. Current Artifactory REST API does not support every option on Docker or NuGet repositories.
It looks like the whole configuration created by calling appropriate REST API calls is stored in a file called artifactory.config.latest.xml.
Is it safe to restore the whole repository configuration just by copying that file?
The artifactory.config.xml that's stored in your filesystem is there mainly for recovery scenarios, although it is perfectly usable, yes.
The thing is, is that you have to restart your instance to have the filesystem changes re-imported into Artifactory (you also need to rename the file to artifactory.config.import.xml for Artifactory to pick it up at startup).
If you're looking for and option to modify repository configuration (or any other configuration Artifactory has for that matter) during runtime you can use this api which retrieves and persists the config.
It's perfectly safe to use as it represents all of the available configuration for all of your repos and the global configuration parameters as well.
Do take care though - it's always a good idea to backup a known working copy before you start playing around - there's no undo button.
Also, this configuration is subject to change as versions progress - you can always consult the config schema if you get lost (note the version - that's the one you have at the top of the xml file declaration).

Spring-Boot multiple db target dependencies

Is there a 'community/Spring' approved method with Boot to have different datasource target for the same project?
Should I include both connector (H2 and Mysql) in the project dependencies and just change the jdbc url in my application.yml?
We are switching our tomcat instance to a Boot project, old habits of having jdbc jar as provided. I was wondering if this was still supported or desired in a boot fat jar/war exec.
If I understood Your question correctly, there are two scenarios, that You could be intrested in.
First is where You use both datasources at once in your project (ex. getting data from both H2 and MySQL in the same time, or one after another).
Second scenario is when You use two datasources but not at once, for example: H2 for test/debug project build, MySQL for production. Another sub-scenario is like You want something like primary/secondary datasources.
Solution for first scenario is to add two dependencies, disable Boot autoconfiguration (autoconfiguration won't work for multiple datasources) for databases and manually configure tho separate EntityManagers etc. (more info here: https://docs.spring.io/spring-boot/docs/current/reference/html/howto-data-access.html#howto-use-two-entity-managers)
Sorry that I can't provide any code sample but I can't access my work repo from home.
Moving to the second scenario what You can do is, use profiles.
You have to create separate profile and application-something.yml file for that profile. Inside you configure your second datasource, and then in dependencies you can make your second database dependency to add only with specific profile as well - but here im not 100% sure, I don't remember how we did it in work ;d.
And again, I cant paste any example but here is some help:
Profiles,
Profile-specific configuration files
An then there is a sub-scenario that I mentioned earlier. Marking datasource as #Primary But here I've never used it, I just know it exists: Link
Edit2: After some rethinking, I think this is the way to go with Boot and active profiles: Spring Boot Maven Plugin
Sorry for a lot of spam, and reconsiderations. That was quite confusing for sure.
Hope that helps,

neo4j community V1.9 - how to specify path of config files in Spring?

I need multiple neo4j embedded databases running on the same machine, on different ports.
I'm building on Spring -- how best to configure via Spring to do that? Ideally I want separate property files for each app, rather than baking the ports in the code -- e.g. /etc/app1.conf, /etc/app2.conf, and to be able to specify the relevant ports and other properties in those files.
I understand that such configuration was once possible in earlier versions of neo4j through a EmbeddedServerConfigurator class, which is no longer present in 1.8+
I'm running 1.9.5 with an eye to 2.0 in the nearish future, so a non-deprecated way of doing this would be much appreciated.
D
Darrell, if you run embedded there are no ports and no config files.
You just provide store-directories and optionally database config to your GraphDatabaseService instances which are (in Spring Data Neo4j) created as spring beans.
Unfortunately there is no compatible way between 1.9 and 2.0 as the public constructors of EmbeddedGraphDatabase were removed in 2.0 and I added a GraphDatabaseServiceFactoryBean in SDN 3.0 / Neo4j 2.0.
To run a server with an embedded Neo4j you'd probably have to go the way of extending CommunityBootstrapper. But here is no out of the box way integrating this in Spring right now.
So to make it work, I'd probably create a subclass of CommunityBootstrapper which starts the server, but can be passed in the GraphDatabaseService from the outside.
See my in-memory-server project for some hints: https://github.com/jexp/neo4j-in-memory-server

Categories