Getting null value in handleMessage(TariffTransaction ttx) method

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Getting null value in handleMessage(TariffTransaction ttx) method

Porag
Hi John,

We have been running our broker (v1.3.2) in server distribution 1.3.3 and we are getting null values when we try to look into the TariffSpecification in the TariffTransaction message handler.

TariffSpecification newSpec = ttx.getTariffSpec();

Here we are getting newSpec = null. We are sending valid tariff specification to the server.

"Sending Tariff Spec to server.
Tariff is valid: true
Tariff Spec: TariffSpecification 200000232 SPOT_MCTS.CONSUMPTION"

Then we tested with sample broker (v1.4.0) and the sample broker was not having this issue.

Then we changed our broker version to v1.4.0 but the problem still exists.

We are using the same logic as the sample broker to send tariff spec to the server. Can you please help us on this issue?

Thanks and best regards,
Porag
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Getting null value in handleMessage(TariffTransaction ttx) method

grampajohn
Administrator
Hello, Porag -

SPOT wrote
Hi John,

We have been running our broker (v1.3.2) in server distribution 1.3.3 and we are getting null values when we try to look into the TariffSpecification in the TariffTransaction message handler.

TariffSpecification newSpec = ttx.getTariffSpec();

Here we are getting newSpec = null. We are sending valid tariff specification to the server.

"Sending Tariff Spec to server.
Tariff is valid: true
Tariff Spec: TariffSpecification 200000232 SPOT_MCTS.CONSUMPTION"

Then we tested with sample broker (v1.4.0) and the sample broker was not having this issue.

Then we changed our broker version to v1.4.0 but the problem still exists.

We are using the same logic as the sample broker to send tariff spec to the server. Can you please help us on this issue?
I'm not exactly sure of the context of this problem. I assume you are seeing this in the broker, after it has received a tariff transaction from the server, and that the tariff specification is one you posted to the server earlier. Does this always happen? What is the transaction? Is this the first transaction for the new tariff, the PUBLISH transaction? Or is it some later transaction? Does this happen for all your tariffs? Have you looked at the server log to see whether there are ERROR entries in the trace log?

Thanks.

John
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Getting null value in handleMessage(TariffTransaction ttx) method

Porag
grampajohn wrote
Hello, Porag -

SPOT wrote
Hi John,

We have been running our broker (v1.3.2) in server distribution 1.3.3 and we are getting null values when we try to look into the TariffSpecification in the TariffTransaction message handler.

TariffSpecification newSpec = ttx.getTariffSpec();

Here we are getting newSpec = null. We are sending valid tariff specification to the server.

"Sending Tariff Spec to server.
Tariff is valid: true
Tariff Spec: TariffSpecification 200000232 SPOT_MCTS.CONSUMPTION"

Then we tested with sample broker (v1.4.0) and the sample broker was not having this issue.

Then we changed our broker version to v1.4.0 but the problem still exists.

We are using the same logic as the sample broker to send tariff spec to the server. Can you please help us on this issue?
I'm not exactly sure of the context of this problem.
I assume you are seeing this in the broker, after it has received a tariff transaction from the server, and that the tariff specification is one you posted to the server earlier. Does this always happen?

Answer : Yes and yes it is always happening.

What is the transaction? Is this the first transaction for the new tariff, the PUBLISH transaction?
Answer : It is for PUBLISH, SIGNUP etc.

Or is it some later transaction? Does this happen for all your tariffs?
Answer : Currently we are publishing only consumption based tariffs. And yes it happens for all the tariffs.

Have you looked at the server log to see whether there are ERROR entries in the trace log?
Answer : I have just looked into the .trace log file and got this :
"
4364007 INFO  TariffMarketService: publishing 1 new tariffs
4364007 INFO  TariffMarketService: publishing spec 200000256 broker: SPOT, exp: null
"

Do you know what is the meaning of exp here?

Thanks.

John
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Getting null value in handleMessage(TariffTransaction ttx) method

grampajohn
Administrator
Hello, Porag -

Does this happen with the 1.3.3 sample broker? If not, then there might be something wrong with your broker code. If you cannot figure it out, I could take a look. If it does it with the sample broker, I should be able to reproduce it, but I'm pretty sure I tested it before that release.

The "exp: null" you were curious about in the tariff-publish message is saying that your tariff has no expiration time. Most tariffs don't. Perhaps it should say something more obvious like "expiration: none".

Cheers -

John
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Getting null value in handleMessage(TariffTransaction ttx) method

Porag
grampajohn wrote
Hello, Porag -

Does this happen with the 1.3.3 sample broker? If not, then there might be something wrong with your broker code. If you cannot figure it out, I could take a look. If it does it with the sample broker, I should be able to reproduce it, but I'm pretty sure I tested it before that release.

The "exp: null" you were curious about in the tariff-publish message is saying that your tariff has no expiration time. Most tariffs don't. Perhaps it should say something more obvious like "expiration: none".

Cheers -

John
No it is not happening with the 1.3.3 sample broker. I just figured out one thing, we missed a line while publishing tariff i.e. tariffRepo.addSpecification(spec); After adding that we are not getting that null spec error and we are able to count customers properly for the first time. After 24+ timeslots later we again get that null spec error.

    public TariffSpecification publishTariff(PowerType type, long supersedes)
    {
        TariffSpecification spec = new TariffSpecification(brokerContext.getBroker(), type);

        double rateValue = minimumEnergyPrice[currentTimeslot] + profitMargin;
        Rate rate = new Rate().withValue(rateValue);
        spec.addRate(rate);
       
        if (supersedes != -1)
        {
            spec.addSupersedes(supersedes);
            TariffSpecification oldSpec = activeTariffs[lastTariff];
            TariffRevoke revoke = new TariffRevoke(brokerContext.getBroker(), oldSpec);
            brokerContext.sendMessage(revoke);
        }

        tariffRepo.addSpecification(spec);
        brokerContext.sendMessage(spec);
        return spec;
    }

Here is how our publishTariff method looks like.  

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Getting null value in handleMessage(TariffTransaction ttx) method

grampajohn
Administrator
Porag wrote
    public TariffSpecification publishTariff(PowerType type, long supersedes)
    {
        TariffSpecification spec = new TariffSpecification(brokerContext.getBroker(), type);

        double rateValue = minimumEnergyPrice[currentTimeslot] + profitMargin;
        Rate rate = new Rate().withValue(rateValue);
        spec.addRate(rate);
       
        if (supersedes != -1)
        {
            spec.addSupersedes(supersedes);
            TariffSpecification oldSpec = activeTariffs[lastTariff];
            TariffRevoke revoke = new TariffRevoke(brokerContext.getBroker(), oldSpec);
            brokerContext.sendMessage(revoke);
        }

        tariffRepo.addSpecification(spec);
        brokerContext.sendMessage(spec);
        return spec;
    }
I think you need to send the new tariff spec before you revoke the old one. Let me know if this fixes it.

Cheers -

John
Loading...