491 karma · joined Dec 30, 2016 (9y ago) · 195 submissions
comment 2mo ago · link · parent
comment 1y ago · link · parent
In the last 5 years, I didn't need anything more than:
- resource plugin - compiler plugin - jar plugin (jars, test jars, javadoc jars) - surefire/failsafe - shade plugin for repackaging to avoid classpath hell - assemble plugin - license plugin
Most of the issues I had were with the shade/assemble/license plugins.
I consider myself a Maven power-user and like the tool compared to others (Gradle is too ant-like, resulting in non-standard builds, sbt is just a torture tool).
With time, I concluded that the simpler it is, the better.
comment 2y ago · link · parent
By calling `poll()` again. It doesn't commit the records returned from poll until auto commit interval expires AND you call poll again.
At least this is what the javadoc says quite clearly: https://kafka.apache.org/39/javadoc/org/apache/kafka/clients...
Note: Using automatic offset commits can also give you "at-least-once" delivery, but the requirement is that you must consume all data returned from each call to poll(Duration) before any subsequent calls, or before closing the consumer.
E.g. the following commits every 10s - on each call to `poll`, it doesn't automagically commit every 5 s.
Properties props = new Properties();
props.setProperty("bootstrap.servers", "localhost:9092");
props.setProperty("group.id", "test");
props.setProperty("enable.auto.commit", "true");
props.setProperty("auto.commit.interval.ms", "5000");
props.setProperty("key.deserializer", "org.apache.kafka.common.serialization.StringDeserializer");
props.setProperty("value.deserializer", "org.apache.kafka.common.serialization.StringDeserializer");
KafkaConsumer<String, String> consumer = new KafkaConsumer<>(props);
consumer.subscribe(Arrays.asList("my-topic"));
while (true) {
ConsumerRecords<String, String> records = consumer.poll(Duration.ofMillis(100));
for (ConsumerRecord<String, String> record : records) {
System.out.printf("offset = %d, key = %s, value = %s%n", record.offset(), record.key(), record.value());
}
Thread.sleep(10_000);
}comment 2y ago · link · parent
The idea that one can ask me a few questions and give good advice when buying a phone, a car, a house etc.. is just bizarre.
Maybe it is not like that in the general population, but it certainly is within technically-minded people.
comment 2y ago · link · parent
comment 2y ago · link · parent
There was a great time at some point in the past where everyone went all in on responsive design and most websites behaved well, what we have nowadays is a regression in usability (at least for power users).
comment 2y ago · link · parent
It's a shame that one needs to use scrips to modify websites used daily (e.g. I do that with Github to span the full width).
comment 2y ago · link · parent
AGPL is not a problem for server-side software if you don't need to modify it. Your application (talking to the server) doesn't become infected by AGPL.
comment 2y ago · link · parent
My understanding is that virtual threads mostly eliminate context switching - for N CPUs JVM creates N platform threads and they run virtual threads as needed. There is no real context switching apart from GC and other JVM internal threads.
A platform thread picking another virtual thread to run after its current virtual thread is blocked on IO is not a context switch, that is an expensive OS-level operation.
comment 2y ago · link · parent
Sure, if the compromised library is one of your core libraries that runs during build, test and runtime, then this does not help. But there are
test libraries only
compile time only libraries (hello lombok?)
transitive dependencies that may not be used during runtime (or run only in rare code paths)
Sometimes compromising the build environment is more valuable than the app's runtime environment - e.g. it may allow the attacker to compromise all apps.Explicitly enabling a particular annotation processor I want to run is small price to pay for the increased security.
comment 2y ago · link · parent
And some architectures are still prohibited - any replicated database across cloud vendors - imagine Cassandra hosted across AWS and Azure to protect against one cloud vendor outage.
comment 3y ago · link · parent
https://www.lenovo.com/us/en/p/laptops/thinkpad/thinkpadp/th...
comment 3y ago · link · parent
Especially considering how hard it is for humans to create something new, e.g in literature - basically all stories have been written and new ones just copy the existing ones in one way or another.
comment 3y ago · link · parent
In Gradle there is are infinite number of ways how to configure it. I haven't seen 2 projects done in the same way, when I want to understand a new gradle build, I need to learn few new Greadle (or Groovy) features.
Sure, in very complex Maven builds there might be some quirks and some plugins have bugs, but it works so much better than anything else out there.
comment 3y ago · link · parent
The same may happen in your project, but if you use simple(r) dependencies, it's less likely.