Сообщения

Сообщения за 2017

SOAP, wildfly

echo server: cat fifo | netcat -k -l 8082 -v | cat > fifo watch -n1 cat fifo ./standalone.sh -c standalone-osgi.xml remote deploy watch: watch -n1 ls -lah standalone/deployments/

сказ о том, как я kafka и Spring поднимал и тестил

java.lang.IllegalArgumentException: Magic v1 does not support record headers это значит кафка старая и не поддерживает хидеры надо просто обновиться. for debug purpose: https://github.com/awaitility/awaitility  https://gist.github.com/itzg/e14fe6965175b65e14881e7c5264c707  kafka: по мотивам:  https://dzone.com/articles/running-apache-kafka-on-windows-os server.properties: кто бы мог подумать что ему не все равно - log.dirs=C:/soft/kafka_2.12-0.10.2.0/tmp/logs так работает а так нет log.dirs=C:\soft\kafka_2.12-0.10.2.0\tmp\logs C:\soft\kafka_2.12-0.10.2.0\bin\windows>kafka-topics.bat --delete --topic s1p.topic --zookeeper localhost:2181 Topic s1p.topic is already marked for deletion. kafka-topics --list --zookeeper localhost:2181 s1p.topic - marked for deletion но когда это фактически случится никто не знает..... и это настораживает! тут надо что - а тут надо копать! Иван Федрыч КАПАЙ делает работу)! src:  https://zookeeper.apache.org/doc/trunk/zookeeperStarted.html#s

OOP Java

static and super keyword           super.static can't because:           Overriding depends on having an instance of a class. The point of polymorphism is that you can subclass a class and the objects implementing those subclasses will have different behaviors for the same methods defined in the superclass (and overridden in the subclasses). A static method is not associated with any instance of a class so the concept is not applicable. There were two considerations driving Java's design that impacted this. One was a concern with performance: there had been a lot of criticism of Smalltalk about it being too slow (garbage collection and polymorphic calls being part of that) and Java's creators were determined to avoid that. Another was the decision that the target audience for Java was C++ developers. Making static methods work the way they do had the benefit of familiarity for C++ programmers and was also very fast, because there's no need to wait until runtime to

java singleton implementations

https://habrahabr.ru/post/129494/ для объектным ссылок volatile можно не писать. я прав? Например, когда мы в многопоточном приложении используем паттерн Синглтон в котором применяем синхронизацию и хотим чтобы синхронизация осуществлялась только один раз при инициализации объекта, а не каждый раз, когда мы вызываем getInstance(), тогда модификатора volatile используем для объектной ссылки: public class Singleton {     private static volatile Singleton instance;     private Singleton(){     }     public static Singleton getInstance() {         if (instance == null) {             synchronized(Singleton.class) {                 if (instance == null)                     instance = new Singleton();             }         }         return instance;     } } volatile это сурово DCL https://web.archive.org/web/20121108114236/http://habrahabr.ru/post/143390/