c++ ActiveMQ sending binary messages - c++

Is it possible to send a stringstream containing binary over activemq? If so, how is this done?
I know the Java version of activemq has a feature called BlobMessage or StreamMessage to do so, however, this isn't implemented in the c++ version yet. I've already read about the BytesMessage class however I can't find any good c++ examples that implements it.
Thanks.

If you've downloaded the source for ActiveMQ-CPP then look for the Unit Tests in the the src/test folder that deal with BytesMessage, that will show you how its done. Also the StreamMessage is supported, BlobMessage is not though.
Here is the API Doc for BytesMessage in CMS.
http://activemq.apache.org/cms/api_docs/activemqcpp-3.2.5/html/classcms_1_1_bytes_message.html
and StreamMessage
http://activemq.apache.org/cms/api_docs/activemqcpp-3.2.5/html/classcms_1_1_stream_message.html
-Tim
www.fusesource.com

Related

signal/Textsecure bindings for c/c++?

I am trying to create a signal/textsecure client using qt and C++, however i cant seem to fibd any C++ bindings for it.
the only bindings i can find are for Go (https://github.com/nanu-c/textsecure/)
is there any way to connect C++ with signal?
edit:
i wanted to clarify some things:
-im talking about the messaging app called Signal (https://signal.org)
-i am trying to write an app for ubuntu touch and am developing on manjaro linux.
On Linux or Unix, you probably want to communicate with other remote applications using some communication protocol, such as HTTP or HTTPS or SOAP or JSONRPC or ONCRPC. Of course read about socket(7) and before that Advanced Linux Programming then about syscalls(2). Consider reading a textbook on Operating Systems
Be sure to study the source code related to Signal. Read their technical documentation.
You surely need to understand the details. So take a few days or weeks to read more about them.
If you want to use some web service, you need to read and understand its documentation and when and how you are allowed to use it. There could be legal or financial issues.
Then you might use HTTP related libraries (e.g. Wt or libonion server side, and libcurl or curlpp client side).
See also in April 2020 the ongoing HelpCovid free software project (for Linux), at least for inspiration. We are coding it in C++.
after a little more digging i found that textsecure bindings are now renamed to libsignal.
after finding that out i found a lib for c/c++
https://github.com/signalapp/libsignal-protocol-c

Does Evernote still support the C++ API?

I wanted to extend an existing C++ application to use Evernote. I have downloaded the C++ SDK for Evernote and the Windows SDK for Evernote. The C++ SDK does not have any documentation. It just consists of a series of C++ files dating back to 2013. The Windows SDK documentation relates to C#. A great language, but not what my existing code is written in.
I have built the Thrift Library and linked it with my test application. I can get it to make an HTTP connection, but checkVersion gives me an EOF exception from THttpTransport::refill.
boost::shared_ptr User_Store_Http_Client = boost::shared_ptr(new THttpClient("sandbox.evernote.com", 443, "/edam/user"));
boost::shared_ptr User_Store_Protocol = boost::shared_ptr(new TBinaryProtocol(User_Store_Http_Client));
UserStoreClient* User_Store = new UserStoreClient(User_Store_Protocol, User_Store_Protocol);
User_Store_Http_Client->open();
User_Store->checkVersion("MyApp", evernote::edam::g_UserStore_constants.EDAM_VERSION_MAJOR, evernote::edam::g_UserStore_constants.EDAM_VERSION_MINOR);
The Windows SDK talks about EnSession objects, which don't appear in the C++ SDK? I am assuming that the C++ SDK is a raw EDAM implementation and that the C# API has a higher level to it.
Does anyone have a working example of C++ code that would help me get started? Where should I go for help on using Evernote from C++? Am I flogging a dead horse with this?
I am struggling to understand how I should use the Evernote C++ API and would appreciate some help.
I found this SDK
https://github.com/d1vanov/QEverCloud
Looks promising so far.

Creating an SNMP agent with Qt and C++

I'm considering adding SNMP support to a simple daemon I wrote under linux. My daemon is written in C++ and Qt5.
I'm looking for an easy way to add this support. I found several MIB creation tools, the problem is writing the agent (or subagent). I'd rather not code this in C, would anyone know of q Qt library that helps out? I found mib2c which will create a skeleton in C (but I'd rather use C++ with Qt).
You can try using CIMPLE, which I've forked on github from it's original website. I've done some cleanup on github and I've attempted to contact the original authors, but they've never returned any of my emails which makes me wonder whether or not they intend to continue supporting the library.
Regardless, it does work and it plays fairly nicely with both Windows and Linux, which have very different styles of implementing SNMP agents. If you google around for "WBEM" you will find some other libraries as well. CIMPLE is the one we used at Fusion-io for SNMP support. It supported C++ fairly well and uses a code generator to handle lots of the boiler plate stuff that's really boring to write and not specific to your application.

SciDB C++ (Windows) Connection using Protocol Buffers

I am trying to connect my scidb server directly via sockets using C++ under windows environment (Winsock2).
I could only find a python example below for the above purpose which seems quite outdated.
https://github.com/artyom-smirnov/scidb4py
The .proto file shipped with the SciDB 14.12 and the one used in the python example are very much different so the example does not work with the SciDB 14.12.
If someone could help me with preferably a C++ (Windows/Linux) working example or update the existing python example.
Atleast if someone could guide me to the documentation part which explains how to use the message format outlined in the .proto file and what to expect in return.
Thanks.
I believe what you may be looking for is https://github.com/Paradigm4/shim.
It is a HTTP API for SciDB. All you have to do is to install this together with your SciDB. You would then use directly your Winsock (or a HTTP protocol library) directly in C/C++, connecting to the SHIM instance.

How do I use the windows network API in Qt?

I am going to put an network status icon in my GUI application. To get the network status notification, I am trying to use the Windows API. For this I am thinking to use NetworkAvailabilityChangedEventHandler in my application. I am very new to programming with the Windows API and framework. Can anybody help me in the following things:
Can the API NetworkAvailabilityChangedEventHandle only be used in C#?
Can I use it in C++ (Qt)?
Which header file must I include? (I checked in MSDN for this. but they are using namespace for this. All the examples are in C#. I am not able to understand how to implement it in my C++ code.)
I will be grateful if somebody can give me a detailed code snippet for using this windows event handler, including the .h file or namespace to be included.
Where did you get the idea to use the NetworkAvailabilityChangedEventHandler delegate?
That is explicitly not part of the Windows API, but rather a delegate function used by the .NET Framework in conjunction with the NetworkChange.NetworkAvailabilityChanged event. That explains why all the examples on MSDN are in C#—because this is only intended to be used in applications targeting the .NET Framework. If you're writing unmanaged C++ using Qt, then you're not using the .NET Framework, and you can't take advantage of its functionality.
The Windows API equivalent is the InternetGetConnectedState function, which returns a value indicating whether or not the system is currently connected to the Internet. You'll find that its MSDN documentation is substantially friendlier towards unmanaged C++ developers, because that's the
primary intended audience. The information that you're seeking is given at the bottom:
Header Wininet.h
Library Wininet.lib
DLL
Wininet.dll
You can find a list of all the WinINet functions here.