Posts

Java Coding Best Practices

1. Java error-handlingPublic methods should throw at most one checked exception 2. Java brain-overloadLoops should not contain more than a single "break" or "continue" statement 3. Java     conventionLong suffix "L" should be upper case 4. JavaDeprecated elements should have both the annotation and the Javadoc tag 5. Java bug"equals(Object obj)" and "hashCode()" should be overridden in pairs 6. Java java8Lamdbas containing only one statement should not nest this statement in a block 7. Java conventionLeft curly braces should be located at the end of lines of code 8. JavaExceptions should not be thrown in finally blocks 9. Java     error-handlingException classes should be immutable 10.Java  error-handlingException handlers should preserve the original exception 11. JavaEmpty arrays and collections should be returned instead of null 12.Java pitfallMethods named "equals" should override O...

Docker to ELK

git clone https://github.com/deviantony/docker-elk.git cd docker-elk docker-compose up ELK will run and next to push logs for our application docker using logging driverFor example push plpatform application docker logs to ELK docker run --log-driver=syslog --log-opt syslog-address=tcp://IP-Address : port  --log-opt syslog-facility=daemon -p 2025:2025 -d platform That's all, we can see in Kibana http://<kibanContainerIP>:5601/ with index logstash-*

Java 9 Extra Edge

Image
Overview Java 9 Features Java platform module system (Jigsaw Project) Interface Private Methods HTTP 2 Client JShell - REPL Tool Platform and JVM Logging Process API Updates Collection API Updates Stream API Improvements Diamond operator for anonymous classes Reactive Programming @Deprecated Tag Changes Miscellaneous Other Features Java Platform Module System (Jigsaw Project) Compilation $ javac -d mods \ src / shailesh /module-info.java \ src / shailesh /com/in/ blr /Vehicle.java src / shailesh /module-info.java \ src / shailesh /com/in/ blr /Vehicle.java Compilation with Module Path $ javac – modulepath   mods   –d  mods   \    src / zoop /module-info.java  \    src / zoop /com/ azul / zoop /alpha/Name.java  src / zoop /module-info.java  src / zoop /com/ azul / zoop /alpha/Name.java  mods / zoop /module...