Categories
Mastering Development

DeadLetterPublishingRecoverer – Dead-letter publication failed with InvalidTopicException for name topic at TopicPartition ends with _ERR

I identified an error when I changed the DeadLetterPublishingRecoverer destionationResolver. When I use: private static final BiFunction<ConsumerRecord<?, ?>, Exception, TopicPartition> DESTINATION_RESOLVER = (cr, e) -> new TopicPartition(cr.topic() + ".ERR", cr.partition()); it works perfectly. However, if you use _ERR instead of .ERR, an error occurs: 2020-08-05 12:53:10,277 [kafka-producer-network-thread | producer-kafka-tx-group1.ABC_TEST_XPTO.0] WARN o.apache.kafka.clients.NetworkClient – [Producer clientId=producer-kafka-tx-group1.ABC_TEST_XPTO.0, transactionalId=kafka-tx-group1.ABC_TEST_XPTO.0] […]

Categories
Linux Mastering Development

How to exclude “DEBUG” without throws “BUG” in grep

I trying to build a command to grep common list of error keywords(e.g. bug occured!, error, exception), but need to exclude common keywords too (e.g. DEBUG tag) without throws the matched line. This command should robust enough to handle miscellaneous of source/log. Let’s say I have this source: $ cat dummy.log 12345 DEBUG debug.log abc […]

Categories
Mastering Development

How to catch exception thrown in a task in a task

i need help with catching exceptions in C#. I have a Windows service which is acting like a wrapper for other modules, so to not have multiple Windows Services i start all modules/agents thats how we call them in that Wrapper Windows Service. Each of this ‘agent’ is started in a own Task. I am […]

Categories
Mastering Development

Serilog MSSqlServer is not logging errors

Before I get into the problem, I must explain where and why I created the code the way I did. I am following a tutorial on PluralSight which explains logging: https://app.pluralsight.com/library/courses/dotnet-logging-using-serilog-opinionated-approach/discussion So, I created a static class and amended it slightly (because the course is out of date) and came up with this: public static […]

Categories
CMS Magento Mastering Development

Magento + ElasticSearch not showing search results

Before I enabled ElasticSearch the search bar would give me a list of categories, products, and blog posts that matched. And when I hit enter the search results page would contain the matching products. After I enabled ElasticSearch the products are no longer in the list with the categories and posts, and the results page […]

Categories
Mastering Development

Python: SqlAlchemy map existing view to ORM Object

I currently try to map an existing view within my postgreSQL DB to an SqlAlchemy ORM object in python. My view has the following name path_number_view and joins some tables together. It is wokring fine. But I am not able to map the view to an ORM object, when starting the application I get an […]

Categories
Mastering Development

php fatal error: cannot redeclare App\Exceptions\Handler::render() in G:\Xampp\htdocs\blog\app\Exceptions\Handler.php on line 55

I am creating a User Roles and Permissions using laravel 5.8, and in that when I want to run PermissionTableSeeder and i run in cmd like this: php artisan db:seed –class=PermissionTableSeeder . But it showing this error: php fatal error: cannot redeclare App\Exceptions\Handler::render() in G:\Xampp\htdocs\blog\app\Exceptions\Handler.php on line 55 and this is my code: <?php namespace […]

Categories
Development

Data Binding based on loaded XML-Model at runtime

My aim is to create an application which acts like an “editor” for xml-files. The UI was done by JavaFx. There is a menu bar, at which the user can “open” a well defined xml-file, which is loaded by Jaxb and is hold as a static variable in a Config-class. Now, the UI should show […]

Categories
Development

NLog MySql .Net Core 3.0 logging not saving to database

I have setup NLog on my project that will save the logging to my audit database (separate from the default database). However, it is failing to write to the database. I have a console logger target as well and that is logging as expected. No errors are shown or given. It merely fails to write […]

Categories
Development

How to send data from HTTP input to ElasticSearch using Logstash ans jdbc_streaming filter?

I want to send data from Http to elasticsearch using logstash and I want to enrich my data using jdbc_streaming filter plugin. This is my logstash config: input { http { id => “sensor_data_http_input” user => “sensor_data” password => “sensor_data” } } filter { jdbc_streaming { jdbc_driver_library => “E:\ElasticStack\mysql-connector-java-8.0.18\mysql-connector-java-8.0.18.jar” jdbc_driver_class => “com.mysql.jdbc.Driver” jdbc_connection_string => “jdbc:mysql://localhost:3306/sensor_metadata” […]