Skip to content

Instantly share code, notes, and snippets.

View KenNguch's full-sized avatar
📶
if you can`t build it ship it

Kennedy Ngure KenNguch

📶
if you can`t build it ship it
View GitHub Profile
rabbitTemplate.setReturnsCallback((returned) -> {
var message = returned.getMessage();
var routingKey = returned.getRoutingKey();
var exchange = returned.getExchange();
log.info("{}: The message was not successfully routed to the queue", returned.getMessage().getMessageProperties().getMessageId());
});
rabbitTemplate.setConfirmCallback((correlation, ack, cause) -> {
if (ack) {
log.info("Received " + (ack ? " ack " : " nack ") + "for correlation: " + correlation);
@KenNguch
KenNguch / DataTableToWorkBook.cs
Last active June 30, 2022 19:05
Export datatable to excel in C# using Interop
public string DataTableToWorkBook(DataTable dt, string postfix)
{
object oMissing = Missing.Value;
Microsoft.Office.Interop.Excel.Application app;
Microsoft.Office.Interop.Excel.Workbooks wkBks;
Microsoft.Office.Interop.Excel.Workbook wkBk;
Microsoft.Office.Interop.Excel.Sheets wkShts;
Microsoft.Office.Interop.Excel.Worksheet wkSht;
@KenNguch
KenNguch / LIFO.cs
Last active June 30, 2022 13:27
C# DATA STRUCTURE IMPLEMENETATION(STACK) .
namespace ConsoleApp;
/*
A stack is a linear Data Structure in Software Engineering that implements a
Last In First Out(LIFO) principle. The most common methods that it requires
include:
- Push
Add an element to the stack. This element can then be accessed first if it was
pushed last.
- Pop