[ 
https://issues.apache.org/jira/browse/QPID-5285?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16714736#comment-16714736
 ] 

Fabrizio Dimitri Porrà commented on QPID-5285:
----------------------------------------------

Thanks a lot, Gordon.

I'm a little bit puzzled trying to create a PR since according to GitHub the 
qpid versions I'am supposed to refer to are the 1.35 and 1.36 only, whereas I'm 
currently working with the 1.38.

Being afraid of making some big big mistake, I'd rather begin my contribution 
by simply attaching the file actually interested by the patch:

*/qpid-cpp-1.38.0/src/qpid/broker/amqp/Incoming.cpp*

For my own purpose, the following change within the method 
*DecodingIncoming::deliver(boost::intrusive_ptr<qpid::broker::amqp::Message> 
received, pn_delivery_t* delivery)* has proved to be effetcive:

void 
DecodingIncoming::deliver(boost::intrusive_ptr<qpid::broker::amqp::Message> 
received, pn_delivery_t* delivery)
{
    qpid::broker::Message message(received, received);

    *timeval timeVal;*
    *gettimeofday(&timeVal, 0);*
    *tm temp;*
    *tm* timeInfo = localtime_r(&timeVal.tv_sec, &temp);*
    *uint64_t timestamp = (uint64_t)(timeInfo->tm_hour * (uint64_t 
)10000000000) +*
    *(uint64_t)(timeInfo->tm_min * (uint64_t )100000000) +*
    *(uint64_t)(timeInfo->tm_sec * (uint64_t)1000000) +*
    *(uint64_t)timeVal.tv_usec;*

    *message.addAnnotation("CreationTime", timestamp);*

    userid.verify(message.getUserId());
    received->begin();
    handle(message, session.getTransaction(delivery));
    Transfer t(delivery, sessionPtr);
    sessionPtr->pending_accept(delivery);
    received->end(t);
}

Hopefully looking forward to getting some hint or feedback from you.

Bye.

> [AMQP 1.0] timestamped messages not supported
> ---------------------------------------------
>
>                 Key: QPID-5285
>                 URL: https://issues.apache.org/jira/browse/QPID-5285
>             Project: Qpid
>          Issue Type: Bug
>          Components: C++ Broker
>    Affects Versions: 0.24
>            Reporter: Gordon Sim
>            Assignee: Gordon Sim
>            Priority: Major
>             Fix For: Future
>
>         Attachments: Incoming.cpp
>
>
> There is a timestamping feature in qpidd that if enabled sets the timestamp 
> field of the AMQP 0-10 delivery-properties when a message arrives at the 
> broker.
> There is no equivalent field defined in the AMQP 1.0 specification. Thus this 
> feature is at present not supported over 1.0 (i.e. messages delivered over 
> 1.0 will not have the timestamp set).
> An annotation could be defined to convey the timestamp for 1.0 messages. This 
> could also be used in translating between 0-10 and 1.0 formats.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to