Questions tagged [message-handlers]

73 questions
1
vote
1 answer

window message management in MFC : Is the addition of the base class call mandatory?

Let's consider this code fragment : BEGIN_MESSAGE_MAP(CMyCheckBox, CButton) ON_WM_MOUSEMOVE() END_MESSAGE_MAP() void CMyCheckBox::OnMouseMove(UINT nFlags, CPoint point) { // here my code .... CButton::OnMouseMove(nFlags, point); // <--…
Landstalker
  • 1,368
  • 8
  • 9
1
vote
1 answer

PostQuitMessage(0) won't terminate my 'program'

I'm just trying to learn a little bit of C++ and wrote a few lines that do nothing but open a window. I've added a Message Handler too and by clicking the [X] on my window it closes as its supposed to. As the next step I wanted the Program to…
user287331
  • 13
  • 3
1
vote
1 answer

An example for Spring Integration with spring-integration-jpa

I see many examples related to spring-integration-file. But I am looking for an example application where it uses spring-integration-jpa to pull data from database using Inbound Channel Adapter and create a Java object out of it. Any help is much…
Vicky
  • 11
  • 2
1
vote
1 answer

Unit testing Custom MessageHandler

I have a custom handler as below: public class LoggingHandler : DelegatingHandler { public LoggingHandler() { } protected override async Task SendAsync( HttpRequestMessage request, …
kauschan
  • 446
  • 2
  • 8
  • 21
1
vote
0 answers

Spring MappingJackson2HttpMessageConverter not getting triggered?

I have a fairly old Java 8 / Spring app which provides a REST API. The response is sent in either JSON or XML depending on the Accept Header. So for example application/json-v1 converts the response to JSON of version 1 of the response…
gringogordo
  • 1,990
  • 6
  • 24
  • 60
1
vote
1 answer

System.Format Exception throw by SendAsync method of Delegate handler

While using a custom message handler, I keep encountering the following error on the API server side: API Controller:- [RoutePrefix("errors")] public class ErrorController : ApiController { [HttpGet] [Route("{id}")] public…
1
vote
2 answers

Route-specific ASP.NET MVC Web API message handler not invoking controller action

I've got an ASP.NET MVC Web API controller: [HttpPost] public async Task Post(HttpRequestMessage req, CancellationToken cancellationToken) {...} And a custom message handler I created: public class MyMessageHandler :…
1
vote
1 answer

Use rebus TransactionContext within a message handler

I am trying to use the Rebus transaction context within my message handler. I have read the documentation here and have seen the sample here, however I do not know how Windsor works. Could somebody make an example of using ITransactionContext with…
Lorenzo
  • 29,081
  • 49
  • 125
  • 222
1
vote
1 answer

What's the best way to communicate with a Service in every activity of my app without replicating the same code?

I implemented a Service and I use a Messenger with its handler as a communication bridge. Every time that I start an activity I have to follow these steps: 1) create the service connection private ServiceConnection mConnection = new…
michoprogrammer
  • 1,159
  • 2
  • 18
  • 45
1
vote
1 answer

Custom message handler with attribute based routing is not working for Web API 2

I have a Message Handler in my Web API 2 project which change the url to a different path. Such as url "root/controller/somevalue/detials" will be changed to "root/controller/2/details". Where "somevalue" or 2 is a parameter for the action method. I…
Tanjeer
  • 89
  • 4
1
vote
1 answer

Spring Integration several messageHandlers

I am new to the Spring Integration and I couldn't find any similar post here. Right now I have one messageHandler which calls specific URI and writes to the channel. @Bean @Scope("prototype") public MessageHandler httpGateway() { if…
1
vote
1 answer

Get response data from SendAsync method ASP.net web API Message Handlers

I want to fetch returned data from Web api and save in my database. My Message handler code is here: protected override async Task SendAsync( HttpRequestMessage request, CancellationToken cancellationToken) { Stopwatch…
GOPAL SHARMA
  • 657
  • 2
  • 12
  • 37
1
vote
1 answer

Remove/add MessageHandlers at runtime

How can I add or remove message handlers at runtime? The following example does not work: var logHandler = GlobalConfiguration.Configuration.MessageHandlers.FirstOrDefault(a => a.GetType() == typeof(ApiLogHandler)); if (logHandler == null) { …
1
vote
2 answers

how to convert async method call ( callback ) to a sync method call in Android

Example: Sync Vesrion: int weather = getWeather(); Async version: getweather(callback) to the other class and when other class ready to return value it use callback. callback.receiveWeather(temperature); and callback object has a overridden…
1
vote
0 answers

Read first n chars of HttpContent

I want to log information about HttpRequestMessage responses in a Visual C# Web API program. I want to use a message handler (inheriting from DelegatingHandler) like this: protected override async Task
alksdjg
  • 1,019
  • 2
  • 10
  • 26